I can't figure out how to write this If df['col1']=='A' then df['col2'].replace('X','Y', inplace = True)
I write something like df[df['col1'] == 'A']['col2'].replace('X','Y', inplace = True) but it is giving me an error and I can't work out a solution to it.
I am trying to get a value in a column replaced, if a condition is met in another column