我想为从 Excel 文件读取的预处理数据集生成肘部图。在下一步中,我想使用 matplotlib 包中的绘图方法生成肘部图。执行代码后我得到以下错误:ValueError: x and y must have same first dimension, but have shapes (10,) and (1,)代码如下所示:plt.plot(range(1, 11), wcss, linewidth = 4, color = 'black', marker = 'D', markersize = 10)plt.title('The Elbow Method', family = 'Arial', fontsize = 14, color = 'black')plt.xlabel('Number of Clusters', family = 'Arial', fontsize = 12, color = 'black')plt.ylabel('WCSS', family = 'Arial', fontsize = 12, color = 'black')plt.xticks(fontsize = 12, color = 'black')plt.yticks(fontsize = 12, color = 'black')plt.grid(which = 'both', color = 'black', axis = 'x', alpha = 0.5)问题可能出在哪里?
添加回答
举报
0/150
提交
取消