python scikit learn KMeans聚类分析绘图报错

目前正在使用Python的scikit learn中的KMeans库进行聚类分析,所使用的数据源有4000多条数据,
其中用于绘制结果的代码如下:

for u,v in enumerate(kmeamsmodel.labels_):
    plt.plot(card['numeducation'][u],card['nummarital'][u],color=colors[u],ls='none')
plt.show()

运行时报错了,报错内容如下

 plt.plot(card['numeducation'][u],card['nummarital'][u],color=colors[u],marker=markers[1],ls='none')
IndexError: list index out of range

我目前使用的Python版本为3.9,运行环境为pycharm2022.1.3社区版。
请问出了什么错误?

【相关推荐】




如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^