首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AttributeError: DataFrame对象没有属性“plot_coordinates”

AttributeError: DataFrame对象没有属性“plot_coordinates”
EN

Stack Overflow用户
提问于 2019-08-29 09:00:13
回答 1查看 1.7K关注 0票数 0

我想用python绘制一个图表,在应用MCA之后在X/Y轴上显示变量。我尝试了这段代码,但返回了以下错误:

AttributeError: DataFrame对象没有属性“plot_coordinates”

这是代码:

代码语言:javascript
复制
ax = mca.plot_coordinates(
X=X,
ax=None,
figsize=(6, 6),
show_row_points=True,
row_points_size=10,
show_row_labels=False,
show_column_points=True,
column_points_size=30,
show_column_labels=False,
legend_n_cols=1)

有人能帮忙吗?

谢谢,

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-11-13 16:30:04

我不知道这是否有帮助,但我也遇到了同样的错误。为了解决这个问题,我指定了X=作为确切的数据和列/变量,它修复了问题: X=trainvariables而不是X=X

代码语言:javascript
复制
ax = mca.plot_coordinates(
X=train[variables],
ax=None,
figsize=(6, 6),
show_row_points=True,
row_points_size=10,
show_row_labels=False,
show_column_points=True,
column_points_size=30,
show_column_labels=False,
legend_n_cols=1)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57706621

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档