I want to generate an elbow plot for a pre-processed dataset which has been read from an excel file. In the next step, I want to generate an Elbow Plot by using the plot method from the package matplotlib. After executing the code I got the following error:
ValueError: x and y must have same first dimension, but have shapes (10,) and (1,)
The code looks like the following:
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)
Where could the problem be?