I have a pandas dataframe with 10 keys. If I try to access a column that is not present, even then it returns a NaN for this. I was expecting a KeyError. How is pandas not able to identify the missing column ?
In the example below, vendor_id is a valid column in dataframe. The other column is absent from the dataset.
final_feature.ix[:,['vendor_id','this column is absent']]
Out[1017]:
vendor_id this column is absent
0 434236 NaN
type(final_feature)
Out[1016]: pandas.core.frame.DataFrame
EDIT 1: Validated that no null values are there
print (final_feature1.isnull().values.any())