这是我的代码,用于在数据框中创建带有计算的新列
df1['Cases/Tests/1M pop']= (df1['Tot Cases/1M pop']/ df1['Tests/ 1M pop'])*100
我在输出中得到了此错误消息
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: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
df1['Cases/Tests/1M pop']= (df1['Tot Cases/1M pop']/ df1['Tests/ 1M pop'])*100