<prompt> Unda hati ya Python inayotekelezea algorithm ya nguzo ya K kutoka mwanzo. Hati inapaswa kukubali seti ya pointi za 2D kama ingizo na kurudisha kazi za nguzo na sentimita baada ya idadi maalum ya marudio.PLINFORMAT  <response>: ingiza numpy kama npdef euclidean_distancepoint1, point2: rudisha np.sqrtnp.sumpoint1 - point2 2def initialize_centroidspointi, k: centroids points.copy np.changanyika.nasibuviini kurudi katikati:kdef closest_centroidpoint, centroids: umbali euclidean_distancepoint, centroid kwa centroid katika centroids rudisha np.argminumbalidef move_centroidspointi, kazi, centroids: new_centroids kwa mimi katika anuwailencentroids: assigned_points pointikazi i ikiwa lenpointed_points 0: new_centroids.appendnp.meanassigned_points, axis0 kwingine: new_centroids.appendcentroidsi rudisha np.arraynew_centroidsdef k_means_clusteringpointi, k, marudio: centroids initialize_centroidspointi, k kwa _ katika masafa marudio: assignments np.arrayclosest_centroidpoint, centroids kwa pointi katika pointi centroids move_centroidspointi, kazi, centroids mgawo wa kurudi, centroidspointi np.array1, 2, 3, 4, 5, 6, 7, 8, 9, 10k 2marudio 100kazi, centroids k_means_clusteringpointi, k, marudioprintKazi:, kazichapisha Vituo:, centroids 