Feb-14-2023, 10:59 AM
(Feb-14-2023, 09:59 AM)Vadanane Wrote: You are getting the "setting with copy" warning because you are trying to assign a value to a subset of a DataFrame without using the .loc accessor. The .loc accessor is used to ensure that the original DataFrame is not modified in place.
To fix this, you should use the .loc accessor when assigning values to a subset of a DataFrame:
dfout.loc[:,3] = dfout.loc[:,0]
dfout.loc[:,4] = dfout.loc[:,1]
dfout.loc[:,5] = dfout.loc[:,2]
dfout.loc[:,6] = np.sqrt(dfout.loc[:,4]**2+dfout.loc[:,5]**2)
dfout.loc[:,7] = np.arctan(dfout.loc[:,5]/dfout.loc[:,4])/np.pi*360
Thank you, but isn't this exactly what I have done?