I can't really find any good solution to this from stackoverflow. I managed to get full word match based on iterating over the list, and assigning the value to a new column. I guess df.lookup could also be used in some way to achieve the same, as well as df.get_value and probably also a join...
This is the solution I got working first. This is for looking up full words, but what is the best way to lookup based on wildcard and take the first result? An example could be having a list of bank transactions, trying to match against names of stores to assign a category.
import pandas as pd
df = pd.read_csv("transactions.csv")
d = {
'SUBWAY': '9',
'TRANSFER TO': '5',
'Best Buy': '8'
}
for index, row in df.iterrows():
if(row['Description'] in d.keys()):
df.at[index, 'Category'] = d[row['Description']]