I need to use the following code:
raw_data.loc[(raw_data['PERMNO']==10006)&(raw_data['month']>=50)&(raw_data['month']<=100)]['resi']=raw_data['RET']-raw_data['ewretd']
that is based on the conditions to calculate column 'resi'.
But I keep getting warnings like
D:\Anaconda3\lib\site-packages\ipykernel_launcher.py:1: 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 """Entry point for launching an IPython kernel.
How to correct this?