I need to search a dataframe column for matching strings within a list and return the match into a new column in the dataframe. The below code works but it is horribly inefficient and I have millions of rows in my dataframe.
import pandas as pd
Cars = {'MakeModel': ['HondaCivic','Toyota_Corolla','FordFocus','Audi--A4']}
df = pd.DataFrame(data=Cars)
mlist = ['Honda','Toyota','Ford','Audi']
for i in df.index:
for x in mlist:
if x in df.get_value(i,'MakeModel'):
df.set_value(i,'Make', x)