I have a Pandas DataFrame with a few columns, but I want to manipulate all of values in a single column (conditionally), like this:
df[my_column] = df[my_column].apply(lambda x: -float(x))
This works, but Pandas gives me a SettingWithCopyWarning.
SettingWithCopyWarning: 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
Is there a problem with the way I'm going about manipulating this column?