I want to map python list based on values of dict. I know how to do that when I have pandas series, but I do not know how to do it with list:
l = ['apple', 'lemmon', 'banana']
x = {'apple':1, 'lemmon':2, 'banana':3, 'chery':4}
l = l.map(x)
print(l)
Desired output:
l = [1,2,3]