Problems with compute centroids (exercise 2, week 1)

Hello colleagues,

I tried to code the compute centroids, but have problem.
I think, we have to use to for-loops
one for the K, the other for the m.
I got stuck, see the errors.
Let me know, your tipps.
Thanks,

Juergen

Notice how in the first test, all your centroids are identical?
image

That’s not correct.

You only need one for-loop, over the centroids (K).

You can use the hints to avoid looping over m.

Perfect, it works, thanks,

Juergen