Looking up multiple dictionary keys in a Pandas Dataframe & return multiple values for matches
问题 First time posting so apologies in advance if my formatting is off. Here's my issue: I've created a Pandas dataframe which contains multiple rows of text: d = {'keywords' :['cheap shoes', 'luxury shoes', 'cheap hiking shoes']} keywords = pd.DataFrame(d,columns=['keywords']) In [7]: keywords Out[7]: keywords 0 cheap shoes 1 luxury shoes 2 cheap hiking shoes Now I have a dictionary that contains the following keys / values: labels = {'cheap' : 'budget', 'luxury' : 'expensive', 'hiking' : 'sport