Peterborough was part of Northamptonshire until 1888.
It then became an independant administrative county known as 'Soke of Peterborough'
As from 1965 it merged with Huntingdonshire to be county of H & P
It is now, as from 1974, along with Hunts, contained in Cambridgeshire.
that being said, on Ancestry every census 1851 - 1901, Peterborough is in County of Northamptonshire.