Just a simple loop:
number_of_labels = 9
for i in range(number_of_labels):
points_of_cluster = X[labels==i,:]
centroid_of_cluster = np.mean(points_of_cluster, axis=0)
print(centroid_of_cluster)
solved How to create for Loop (issue)?
Just a simple loop:
number_of_labels = 9
for i in range(number_of_labels):
points_of_cluster = X[labels==i,:]
centroid_of_cluster = np.mean(points_of_cluster, axis=0)
print(centroid_of_cluster)
solved How to create for Loop (issue)?