How to get value in order with a small average value
I've got a data frame like
x  y    cluster
0  112  4
0  113  4
1  111  4

and I'll get locations from this code:
for n in range(0,9): 
...
    location = np.array(cluseter_location )

I want to sort it out in the order of column 'cluster' with small columns 'y' means, so I tried:
for n in range(0,9):
    cluster_ = data2[data2['cluster_id']== n]

    ...


Modifying your code to sort list of tuples
In your code, instead of appending the cluster_int, just append the tuple (n, cluster_int), and then later while sorting, use lambda to sort by the second value of each tuple.
for n in range(0,9):
    cluster_ = data2[data2['cluster_id']== n]

    cluster_list = cluster_['y'].tolist()
    cluster_avg = sum(cluster_list)/len(cluster_list)

    cluster_int = int(cluster_avg)

    print(&quot;cluster_id : %d&quot; %n ,&quot;average : %d&quot; %cluster_int)
    lst.append((n,cluster_int))                              #&lt;-------
    a = sorted(lst, key = lambda x:x[1])                     #&lt;-------


print(a)                                                     #&lt;-------

ordered_average = [average for cluster, average in a]        #&lt;-------
ordered_clusters = [cluster for cluster, average in a]       #&lt;-------

print(ordered_average)                                       #&lt;-------
print(ordered_clusters)                                      #&lt;-------

#cluster and average together
[(4,112),(8,121,(1,127),(6,139),(5,149)]

#averages sorted
[112, 121, 127, 139, 149]

#clusters sorted
[4,8,1,6,5]


Alternate way using pandas
A quicker way to do this would be directly sorting the pandas dataframe after groupby.
print(df.groupby('cluster')['y'].mean().reset_index().sort_values('y'))

