I am trying to remove asterisks from strings in a pandas dataframe column efficiently.
I have tried the using replace function alone, but it doesn't change the values in my dataframe. If I use the following code, I get the desired effect:
dfc['Trimmed Peptide'] = dfc['Trimmed Peptide'].str.replace('*', '', regex=False)
Unfortunately, I also get this warning: "A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead."
When I try
dfc.loc['Trimmed Peptide'] = ...
I still get the error. How can I avoid copying the array?