Segregate numerical and categorical (dtype = "object") columns from the DataFrame, and also keep track of columns which have all unique values (like instance ids).
Fill in NULL/NaN values with mean, for numerical and mode for categorical features.
Type cast categorical data to Pandas "category" data type and use its inbuilt 'codes' method to encode the feature into integers.
Return a dictionary with {column name : corresponding value at requested index} as key : value pairs.
Discuss the approach here before implementing