I have some fields that have some junk in them from an upstream process. I\'m trying to delete \'\\r\\nName: hwowneremail, dtype: object\' from a column th
alternatively you can use:
report_df.Owner.str.replace(r'\r\n.*', '')
As far as I remember, Python Pandas was changed a little bit in replace. You should try passing over a regex keyword argument.
Like so;
report_df['Owner'].replace({'\r\nName: hwowneremail, dtype: object':''},regex=True)
Or sometimes just make sure there is no white space before or after the character/str you are looking for(expl. ? ):
df.replace(r'\s*\?\s*', np.nan, regex=True)
or just make sure you specify you are looking for a string:
df.replace(r'\?', np.nan, regex=True)
and for both cases: and don`t forget
regex=True