我在控制台里遇到了以下有关 Python 的警告。我没有找到解决方案。我们不想压制警告。同时,我们有一个庞大的代码库。如何知道哪些代码块导致了这个错误?因为警告没有给出代码行数。
我使用的是以下版本的 Python 和 Numpy。这是因为 Python 和 Numpy 版本过旧所导致的吗?
Python 版本- 3.6.8 Numpy 版本- 1.19.5 Matplotlib 版本是 3.3.4 Pandas 版本是 1.1.5
警告:
/python3.6/site-packages/matplotlib/cbook/__init__.py:1402: FutureWarning: Support for multi-dimensional indexing (e.g.
我使用的是以下版本的 Python 和 Numpy。这是因为 Python 和 Numpy 版本过旧所导致的吗?
Python 版本- 3.6.8 Numpy 版本- 1.19.5 Matplotlib 版本是 3.3.4 Pandas 版本是 1.1.5
警告:
/python3.6/site-packages/matplotlib/cbook/__init__.py:1402: FutureWarning: Support for multi-dimensional indexing (e.g.
obj[:, None]
) is deprecated and will be removed in a future version. Convert to a numpy array before indexing instead.
python3.6/site-packages/pandas/core/indexing.py:1743: 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