I get the error mentioned in the question when I try to do the elbow method, which I\'m doing to do KMeans clustering.
Steps I took to solve the issue: