I have a dataframe which has a column of name.I have another dictionary which has names as keys and values associated with it.I want to search a name in dataframe and add corresponding value from dictionary in a new coloumn.
my dictionary
fruits={'mango':1,'apple':2,'guava':0,'nut':1}
my dataframe
Fruit
mango
apple
guava
nut
Expected Output
Fruit Frequency
mango 1
apple 2
guava 0
nut 1
The data frame is already there.I just want to map the values with the corresponding element
Also if my Dictionary has more key-value pair than my original dataframe How can I add the keys and corresponding values to dataframe.
Suppose if my dataframe is
Fruit
mango
apple
And now I would like to have just nut and not guava because it has value 0
So expected output would be
Fruit Count
mango 1
apple 2
nut 1