尝试绘制Seaborn catplot时出现错误,咨询报错原因
catplot报错原因及修复方案
- 报错根源是参数传递错误:你给
x、y传入的是data['Type of property']、data['Price']这类Series对象,但catplot的x、y参数只需要传入数据框中对应列的名字字符串——毕竟已经通过data=data指定了整个数据源,无需单独提取列。 - 修正后的代码:
sns.catplot(data=data, x='Type of property', y='Price')
内容的提问来源于stack exchange,提问作者Tanay
相关产品推荐
相关产品推荐

