Python Seaborn TypeError:无法根据规则将数组数据从数据类型(';int64';)转换为数据类型(';int32';);安全';

Python Seaborn TypeError:无法根据规则将数组数据从数据类型(';int64';)转换为数据类型(';int32';);安全';,python,error-handling,seaborn,typeerror,Python,Error Handling,Seaborn,Typeerror,我有以下代码,当我运行它时,我不断得到一条“TypeError:Cannotcastarydatafromtype('int64')到dtype('int32'),根据规则'safe'”消息 我已将anaconda3中algorithms.py文件的第84行调整为: resampler = integers(0, n, n, dtype=np.int_) 这似乎无法解决问题。我正在运行的当前版本是: 熊猫:1.0.3 Numpy:1.18.2 Seaborn:0.10.0我有Seaborn 0

我有以下代码,当我运行它时,我不断得到一条“TypeError:Cannotcastarydatafromtype('int64')到dtype('int32'),根据规则'safe'”消息

我已将anaconda3中algorithms.py文件的第84行调整为:

resampler = integers(0, n, n, dtype=np.int_)
这似乎无法解决问题。我正在运行的当前版本是: 熊猫:1.0.3 Numpy:1.18.2
Seaborn:0.10.0

我有Seaborn 0.10.0版本。我也犯了同样的错误。我安装了seaborn 0.9.0版本。 在命令提示符下运行以下命令:

  • 激活
  • python-mpip安装seaborn==0.9.0
  • 安装后,我尝试运行,错误得到解决。
    希望这也能对您起作用。

    调整了上面的代码-“sex”为“tip”插入:导入熊猫作为pd导入numpy作为np导入seaborn作为sns导入matplotlib.pyplot作为plt tips=sns.load_数据集('tips')打印(tips.head())sns.barplot(x='tip',y='total\u bill',data=tips)plt.show()
    resampler = integers(0, n, n, dtype=np.int_)