i'm new to python and i'm trying to write a manual k-means clustering algorithm but i could not execute the code while there is no errors what could be wrong in the code? Here is the code:import numpy as npimport matplotlib.pyplot as pltimport matplotlib.animation as animation%matplotlib inlinedef euclidian(a, b):#euclidian distance between 2 data points a and b. For as many data points as necessary. return np.linalg.norm(a-b)def kmeans(k, epsilon=0, distance='euclidian'):if distance == 'euclidian':    dist_method = euclidiandata = np.array([[1,2]       ,[5,8],       [3,3],       [8,8],       [1,1],       [9,11]])#to get the number of rows (points) and columns (features) from the datasetnum_points, num_features = data.shape#model>>cluster numpy.random.randint(low, high=None, size=None, dtype='l')#Return random integers from low (inclusive) to high (exclusive).models = data[np.random.randint(0, num_points - 1, size=k)]models_old = np.zeros(models.shape)#np.zeros>> Return an array of zeros with shape and type of the inputbelongs_to = np.zeros((num_points, 1))norm = dist_method(models, models_old)iteration = 0#while norm > epsilon:n = 0while n > 10:    n += 1    iteration += 1    norm = dist_method(models, models_old)    for index_point, point in enumerate(data):        #define a vector for the distance  of size k        dist_vec = np.zeros((k,1))        #for each centroid        for index_model, model in enumerate(models):             #compute the distance between each point and centroid            dist_vec[index_model] = dist_method(model, point)        #find the smallest distance, assign that distance to a cluster        belongs_to[index_point, 0] = np.argmin(dist_vec)     #tmp>>tmporary        tmp_models = np.zeros((k, num_features))    #for each cluster (k of them)    for index in range(len(models)):        #to get all the points assigned to a cluster        points_close = [i for i in range(len(belongs_to)) if belongs_to[i] == index]        #to find the mean of those points, to be our new centroid        model = np.mean(data[points_close], axis=0)        #add the new centroid to our new temporary list        tmp_models[index, :] = model    #to set the new list to the current list    models = tmp_modelsreturn models, belongs_to#ploting algorithmdef plot(data, belongs_to):#we'll have 2 colors for each centroid clustercolors = ['r', 'g']#split our graph by its axis and actual plot#fig, ax = plt.subplots()#for each point in our datafor index in range(data.shape[0]):    #to get all the points assigned to a cluster    points_close = [i for i in range(len(belongs_to)) if belongs_to[i] == index]    #to assign each datapoint in that cluster a color and plot it    for point_index in points_close:        ax.plot(data[point_index][0], data[point_index][1], (colors[index] + 'o'))        plot(data, belongs_to)def execute(): data = np.array([[1,2]       ,[5,8],       [3,3],       [8,8],       [1,1],       [9,11]])#train the model on the data#centroids, belongs_to = kmeans(2)#plot the results plot(data, kmeans(2)[1])%matplotlib notebookexecute()
k-means clustering algorithm implementation python 3
python;machine learning;clustering