我有一个有两列的数据帧。我正在尝试使用以下指令添加新的空列:
df['new_col'] = ''
列已添加,但带有警告:
<ipython-input-16-779f11834aea>: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: https:
我到底做错了什么?为什么会触发此警告?
提前谢谢