I need to compare each value of a list to each value of a df column, and if there is a match take the value of another column.
I have a couple of loops working with iterrows but the code is taking a long time to run. I was wondering if there is a more efficient way to do this? It seems .loc might be a good answer but the docs aren't super clear on how to make it work for this usecase.
My code so far is
listy = []
for view in joined_views:
for row in df.iterrows():
if view == row[1]['other_view']:
listy.append(row[1]['other_column']