Error in C3_W1_KMeans_Assignment : int is not iterable

Please help me with this.

Maybe if you try;

for j in range(centroids.shape[0]).

But its already centroids.shape[0].

Please look at my code and correct me where I am going wrong.

You shouldn’t be posting code here its against the rules. I told you I think you should use range(int) so range(K) or range(centroids.shape[0]), that’s what I think.

1 Like