I am trying to do a replace across one column of a pandas dataframe like the below.
From:
a b
house ho
cheese ee
king ng
To:
a b
use ho
chse ee
ki ng
My attempt is to use:
df['a'] = df['a'].str.replace(df['b'], "")
but I get TypeError: 'Series' objects are mutable, thus they cannot be hashed
I have done it by iterating row by row across the dataframe but its 200,000 rows so would take hours. Does anyone know how I can make this work?