我想用python绘制一个图表,在应用MCA之后在X/Y轴上显示变量。我尝试了这段代码,但返回了以下错误:
AttributeError: DataFrame对象没有属性“plot_coordinates”
这是代码:
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)有人能帮忙吗?
谢谢,
发布于 2019-11-13 16:30:04
我不知道这是否有帮助,但我也遇到了同样的错误。为了解决这个问题,我指定了X=作为确切的数据和列/变量,它修复了问题: X=trainvariables而不是X=X
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)https://stackoverflow.com/questions/57706621
复制相似问题