/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/pandas/core/indexing.py:1596: 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 self.obj[key] = _infer_fill_value(value) /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/pandas/core/indexing.py:1763: 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 isetter(loc, value)
时间: 2023-10-09 22:16:27 浏览: 331
解决-BASH: /HOME/JAVA/JDK1.8.0_221/BIN/JAVA: 权限不够问题
这是一个 pandas 库的警告信息,通常出现在使用索引对 DataFrame 进行切片并赋值操作时。警告信息的意思是,用户试图对一个 DataFrame 对象的一个切片进行赋值操作,但是该操作会先对切片对象进行一次复制操作(copy),然后再对复制出来的对象进行赋值。这样的操作可能会导致意外修改原始数据或者引用错误的数据。为了避免这种风险,建议使用 .loc 或 .iloc 操作符进行赋值操作。同时,也可以在操作前使用 .copy() 方法对 DataFrame 对象进行显式的复制操作,以避免警告信息的出现。
阅读全文