Hi @Puneeth, you use something like this:
f = pd.DataFrame({'Fruits':['1.apple','2.Mangoes', np.nan],
'quality':['1.Good','2.Bad']})
print (df)
d={x:df[x].str.extract(r'(\d+)\.(.+)').dropna().set_index(0)[1].to_dict() for x in df.columns}
print (d)
{'Fruits': {'1': 'Apples', '2': 'Mangoes'},
'Ethnicity': {'1': 'Good', '2': 'Bad'}}
df1 = pd.DataFrame({'Fruits':[1,1,2],
'Quality':[2,2,1]})