我有一个pandas
包含整数和浮点值的数据集:
>>> df2[['AGE_REF', 'RETSURV']].dtypes
AGE_REF int64
RETSURV float64
dtype: object
我想使用熊猫绘制联合分布。我没有看到 pandas 可视化联合分布的简单方法,但我偶然发现了seaborn
. 因此,我尝试调整我已经找到的用于我的目的的代码:
>>> import seaborn as sns
>>> sns.jointplot('AGE_REF', "RETSURV", df2,
kind="hex")
Traceback (most recent call last):
File "<input>", line 2, in <module>
File "/usr/local/lib/python2.7/site-packages/seaborn/distributions.py", line 969, in jointplot
gridsize = int(np.mean([x_bins, y_bins]))
OverflowError: cannot convert float infinity to integer
我发现了一个相关的错误报告,所以我尝试在那里遵循解决方法 - 没有成功:
>>> sns.jointplot('AGE_REF', "RETSURV", df2,
kind="hex", marginal_kws={"bins": 10})
Traceback (most recent call last):
File "<input>", line 2, in <module>
File "/usr/local/lib/python2.7/site-packages/seaborn/distributions.py", line 969, in jointplot
gridsize = int(np.mean([x_bins, y_bins]))
OverflowError: cannot convert float infinity to integer