【发布时间】:2020-09-13 18:10:08
【问题描述】:
当我尝试绘制这个时,我得到了错误-
sns.distplot(X_train, x='Age') #Age is a feature in X_train
当我尝试在其中添加 hue 参数时遇到类似的错误
sns.distplot(X_train['Age'], hue=y_train)
TypeError: distplot() got an unexpected keyword argument 'hue'
我做错了什么?这是我尝试代码的地方-
【问题讨论】:
-
displot(not) - 和 notdistplot- 在链接中使用。我怀疑这是一个错字,不幸的是,它的方法名称非常相似。 -
(如果是这样,请考虑关闭 或 self-voting-to-close 作为拼写错误。)
-
sns.distplot(X_train, x='Age', data=X_train)。第一个参数仅设置要使用的数值数据。data=...告诉使用哪个数据框。另请参阅 what is major difference between histogram,countplot and distplot in Seaborn library? 了解类似名称的函数。 -
FWIW,
disTplot已弃用。 -
@user2864740 您能否将其添加为答案,以防其他人遇到同样的问题?此外,事实证明 kaggle 使用的是 seaborn 0.10.0,因此无法识别
displot
标签: data-visualization seaborn