I have an error trying to replace the value
table.loc[table['Column1'].str.contains('Unnamed'), 'Column1'] = np.NaN
A value is trying to be set on a copy of a slice from a DataFrame
Any suggestion?
I have an error trying to replace the value
table.loc[table['Column1'].str.contains('Unnamed'), 'Column1'] = np.NaN
A value is trying to be set on a copy of a slice from a DataFrame
Any suggestion?
You could use the apply method
def changer(x):
if 'unnamed' in x:
x= np.NaN
return x
df['column'].apply(changer)