首页 > 解决方案 > 绘制变量之间的关系 - Python

问题描述

titanic我正在尝试在经典数据的变量之间创建成对散点图,特别是train.csv. 这是代码:

#scatterplot
sns.set()
sns.pairplot(df, dropna=True)
plt.show()

但它向我显示以下错误:

ValueError: max must be larger than min in range parameter.

标签: pythonplotseaborn

解决方案


您的数据框中可能有 NaN。这是您在尝试使用包含 NaN 的数组创建散点图和直方图时会看到的错误。


推荐阅读