Help needed with C3_W1_KMeans_Assignment

For Exercise 2 of this assignment, my code seems to be exactly the same as the code from the hints. However, I’m getting this error:
AssertionError: Wrong values. Expected: [[ 0.13333333 0.43333333]
[-1.33333333 -0.5 ]
[-1.6 1.2 ]], got: [[nan nan]
[nan nan]
[nan nan]]

I’ve tried to debug it, but can’t find a reason why it’s giving me this nan value. It seems like the points is being an empty vector, but when i calculate X[idx == K] explicitly, like X[idx == 0], I get an output. Help would be appreciated!

Hello @Won_June_Kevin_Cho,

You can get this error when it does not find any match in X[idx == K]. Not that the capital K means the number of centroids.

Raymond