0

df_max['Data_Value'] = df_max['Data_Value']/10 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

  • What is code before `df_max['Data_Value'] = df_max['Data_Value']/10` ? – jezrael May 16 '20 at 11:26
  • df3_max = df3[df3['Data_Value'] > df3['Month'].map(df_max['Data_Value'])] df4_min = df3[df3['Data_Value'] < df3['Month'].map(df_min['Data_Value'])] plt.scatter(df3_max.Month.tolist(),df3_max['Data_Value'],s=10,c='red') #values over max plt.scatter(df4_min.Month.tolist(),df4_min['Data_Value'],s=10,c='black') #values under min plt.xticks(list(df_max.index),['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec']) – shubha shree May 16 '20 at 11:44
  • So add copy like `df3_max = df3[df3['Data_Value'] > df3['Month'].map(df_max['Data_Value'])].copy()` and `df4_min = df3[df3['Data_Value'] < df3['Month'].map(df_min['Data_Value'])].copy()` – jezrael May 16 '20 at 11:45

0 Answers0