pandas.scatter_matrix 返回错误:在 Matplotlib 3.2 中不推荐使用 rowNum 属性,并将在两个次要版本后删除 [英] pandas.scatter_matrix is returning the error: The rowNum attribute was deprecated in Matplotlib 3.2 and will be removed two minor releases later

查看:352
本文介绍了pandas.scatter_matrix 返回错误:在 Matplotlib 3.2 中不推荐使用 rowNum 属性,并将在两个次要版本后删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to sketch a feature pairwise plot using pandas.plotting , scatter_matrix function but I get the following error that I cant understand the meaning or what I should do to fix it:

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]

推荐答案

我遇到了同样的问题,这的确是熊猫的问题.此问题已被识别并修复 - 只需获取最新版本的 Pandas 即可解决问题.

I had the same issue and it was indeed an issue with pandas. This issue has been recognised, and fixed - simply getting the latest Version of Pandas should do the trick.

这篇关于pandas.scatter_matrix 返回错误:在 Matplotlib 3.2 中不推荐使用 rowNum 属性,并将在两个次要版本后删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆