I have a dictionary that looks like this
dict = {\'b\' : \'5\', \'c\' : \'4\'}
My dataframe looks something like this
A B 0
This can be done simply
df['B'] = df['B'].fillna(df['A'].apply(lambda x: dict.get(x)))
This can work effectively for a bigger dataset as well.