how to give index of clustered array python?
<p>i've try to run this K-Medoids python implementation  code </p>

<pre><code>from sklearn.metrics.pairwise import pairwise_distances
import numpy as np

import kmedoids

# 3 points in dataset
data = np.array([[1,1], 
                [2,2], 
                [10,10]])

# distance matrix
D = pairwise_distances(data, metric='euclidean')

# split into 2 clusters
M, C = kmedoids.kMedoids(D, 2)

print('medoids:')
for point_idx in M:
    print( data[point_idx] )

print('')
print('clustering result:')
for label in C:
    for point_idx in C[label]:
        print('label {0}:　{1}'.format(label, data[point_idx]))
</code></pre>

<p>(<a href="https://github.com/someus/kmedoids" rel="nofollow">https://github.com/someus/kmedoids</a>) and it shows:</p>

<blockquote>
  <p>medoids:</p>
  
  <p>[1 1]</p>
  
  <p>[10 10]</p>
  
  <p>clustering result:</p>
  
  <p>label 0:　[1 1]</p>
  
  <p>label 0:　[2 2]</p>
  
  <p>label 1:　[10 10]</p>
</blockquote>

<p>But i wanna insert index on its clustering result like this:</p>

<blockquote>
  <p>medoids:</p>
  
  <p>[1 1], index 1</p>
  
  <p>[10 10], index 3</p>
  
  <p>clustering result:</p>
  
  <p>label 0:　[1 1], index 1</p>
  
  <p>label 0:　[2 2], index 2</p>
  
  <p>label 1:　[10 10], index 3</p>
</blockquote>

<p>Does anyone knows how to make it?
Thank you</p>