【问题标题】:RuntimeWarning: invalid value encountered in greater large = s > cutoffRuntimeWarning:在更大的大= s > cutoff中遇到无效值
【发布时间】:2020-11-09 22:15:17
【问题描述】:
sns.lmplot(x='day_diff',y='add_child_21',data=mean, hue='treatment',ci=90,height=6,aspect=1.4, fit_reg=True)

此代码无法在左侧绘制 LM 回归。我没有缺失值或无限值。

错误:RuntimeWarning:在更大的大 = s > 截止中遇到无效值

【问题讨论】:

  • 很难判断出了什么问题。使用模拟数据对我来说没问题。你能发布数据吗?

标签: python numpy seaborn


【解决方案1】:

我使用了你的数据并绘制了,我没有收到错误:

import pandas as pd
import seaborn as sns

df = pd.read_csv("https://raw.githubusercontent.com/andrahiriscau/data/main/data.xls")

sns.lmplot(x='day_diff',y='add_child_21',data=df,
           hue='treatment',ci=90,height=6,aspect=1.4, fit_reg=True)

【讨论】:

  • 谢谢。我的 Python 可能有问题
  • 您使用的是哪个 Python 版本?
  • 这是一个环境问题。我为该项目创建了一个新环境并且它可以工作。注意:Jupyter 仅在第二天开始工作,但代码立即从命令行运行。
  • hmmm 那么环境中的安装肯定有问题。我猜你正在使用 conda.. 可能有点问题
猜你喜欢
  • 2013-02-18
  • 2021-12-28
  • 2018-04-30
  • 1970-01-01
  • 2020-08-14
  • 2016-10-13
  • 2013-01-29
  • 1970-01-01
相关资源
最近更新 更多