A value is trying to be set on a copy of a slice from a DataFrame
df_delta_fred.delta_thk[df_delta_fred.delta_thk < 0] = 0
解决报错:
df_delta_fred.loc[(df_delta_fred.delta_thk < 0), 'delta_thk'] = 0
2024-02-04 15:52:58
A value is trying to be set on a copy of a slice from a DataFrame
df_delta_fred.delta_thk[df_delta_fred.delta_thk < 0] = 0
解决报错:
df_delta_fred.loc[(df_delta_fred.delta_thk < 0), 'delta_thk'] = 0