Reading the household and population data in python
pdata = pd.read_csv('psam_p18.csv')
hdata = pd.read_csv('psam_h18.csv')
Changing the serial number to string to avoid datatype mismatch when merging using serial no.
pdata = pdata.astype({'SERIALNO':'string'})
hdata = hdata.astype({'SERIALNO':'string'})
Merging the datasets using left join to keep all the records from population data and matching records from housing data
in_data = pd.merge(pdata, hdata, how = 'left', on = 'SERIALNO')
Now, calculating the number Total Households Age 55+ Living Alone
a = in_data[(in_data.AGEP >= 55) & (in_data.HHT.isin([4, 6]))]
a.WGTP.sum()
The number I get is "184320" where as the number given by MDAT is "443428"