Assignment 1 questions

for the 2nd question, on the computing of centroids, how does indexing X with the K value collate the points for the specific K value. Like whats happening under the hood of the code. can someone explain to me.

Hello @zheng_xiang1

Please check out this tutorial for numpy’s Boolean array indexing.

This blog looks good too.

If you need to search more, “numpy Boolean array indexing” are the useful keywords to start with.

Cheers,
Raymond

1 Like

thanks ray for being the mvp again and again !!! super thankful