I have a similar problem to this question similar question. However, I need to replace values in the same column given different conditions. Something like the code below
for item in items:
df.loc[df['A'] == item,'A'] = 'other'
where items is a list with different strings that I need to replace with 'other' in column 'A'. The thing is that my dataframe is very large and this approach is very slow. Is there a faster way to do it?