I have a dataframe of two columns. First one["lemm"] of what words to change if they occur. Second one["word"], what to change them to. I'm new to this so I spent a lot of time writing what I think is sloppy code as it iterates through a df and is slow. But, I just want to know if there's a better way to do this for my own learning.
lemm is the df with the two columns(The Lemmatization df). df is where I need to do the lemmatization(just 1 column with a bunch of words).
for words in lemm["lemm"]:
if words in df[0].values:
df[df[0]==words] = lemm['word'].loc[lemm["lemm"]==words].values[0]