I want to copy one column into a new one. I use this code:
df['income10']=df['income'].copy(deep=False)
I get this error:
/Users/hairy/ipykernel/ipykernel_launcher.py:2: 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
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
By adding shallow copy I thought I would've prevented the error.