2

我正在尝试使用 pandas.plotting , scatter_matrix 函数绘制一个特征成对图,但我收到以下错误,我无法理解其含义或我应该如何解决它:

from matplotlib import cm
        from pandas.plotting import scatter_matrix as sm
        import matplotlib.pyplot as plt
        `enter code here`import pandas as pd

    cmap = cm.get_cmap('gnuplot')
    scatter = sm(X_train, c=y_train, marker="o", s=40, hist_kwds={ 'bins': 15}, figsize=(12, 12), cmap=cmap)
/usr/local/lib/python3.7/site-packages/pandas/plotting/_matplotlib/tools.py:304: MatplotlibDeprecationWarning: 
The rowNum attribute was deprecated in Matplotlib 3.2 and will be removed two minor releases later. Use ax.get_subplotspec().rowspan.start instead.
  if not layout[ax.rowNum + 1, ax.colNum]:
/usr/local/lib/python3.7/site-packages/pandas/plotting/_matplotlib/tools.py:304: MatplotlibDeprecationWarning: 
The colNum attribute was deprecated in Matplotlib 3.2 and will be removed two minor releases later. Use ax.get_subplotspec().colspan.start instead.
  if not layout[ax.rowNum + 1, ax.colNum]
4

2 回答 2

1

我有同样的问题,这确实是熊猫的问题。这个问题已被识别并修复 - 只需获取最新版本的 Pandas 就可以解决问题。

于 2020-03-18T18:12:56.240 回答
0

似乎与熊猫内部绘图功能有关。我遇到了同样的错误,但是当我从 df['col'].plot() 更改为 plt.plot(df['col'] 时,错误消失了。

于 2020-03-11T10:58:40.213 回答