Hi all,
I implemented the find_closest_centroids function this way:
{moderator edit: code removed}
I know it’s not the expected solution from the hints, but I wanted to implement it as I know.
The result I received was good, meaning I received the output: First three elements in idx are: [0 2 1]
But then unit test printed:
AssertionError Traceback (most recent call last)
in
11 from public_tests import *
12
—> 13 find_closest_centroids_test(find_closest_centroids)
There are a couple of corrections that need to be made to the find_closest_centroids function that you provided. Firstly, both loops should start from index 0 instead of 1, so it should be range(M) and range(K) .
Here, you forget to assign current distance to the variable temp .
My apologies Tom, It was done absentmindedly.
If I will need to get feedback on my code in the future, how is it available? Is there a way to contact the mentors personally?