title: Scikit learn Kmeans assigning a label to input data
body: <p>I want to assign a label to each input data; for example, data[0] is 'k', data[2] is 'b', data [5] is 'j', data[13] is another 'k',....etc. </p>
  
  <p>After doing the clustering displayed here:  <a href="https://i.stack.imgur.com/saVU7.png" rel="nofollow noreferrer">3D plot of 2 clusters</a>, I want to retrieve the type of each "point label" in every cluster.</p>
  
  <pre><code>import numpy as np
  from sklearn.cluster import KMeans 
  import matplotlib.pyplot as plt
  from mpl_toolkits.mplot3d import Axes3D
  
  data = np.array([[-7.82,4.58,-3.97],[-6.68,3.16,2.71],
  [4.36,-2.19,2.09],[6.72,0.88,2.80],
  [-8.64,3.06,3.50],[-6.87,0.57,-5.45],
  [4.47,-2.62,5.76],[6.73,-2.01,4.18],
  [-7.71,2.34,-6.33],[-6.91,-0.49,-5.68],
  [6.18,2.81,5.82],[6.72,-0.93,-4.04],
  [-6.25,-0.26,0.56],[-6.94,-1.22,1.13],
  [8.09,0.20,2.25],[6.81,0.17,-4.15],
  [-5.19,4.24,4.04],[-6.38,-1.74,1.43],
  [4.08,1.30,5.33],[6.27,0.93,-2.78]])
  
  
  centers = np.array([[1,1,1],[-1,1,-1]])
  model_ = KMeans(n_clusters=2, init = centers, n_init=1).fit(data)
  print('The labels for Part a are %s' % model_.labels_)
  fig = plt.figure()
  ax = Axes3D(fig)
  ax.scatter(data[:,0], data[:,1],  data[:,2],c=model_.labels_.astype(float),s=70)
  plt.title('Visualizing Clusters')
  ax.set_xlabel('X1', fontsize = 10)
  ax.set_ylabel('X2', fontsize = 10)
  ax.set_zlabel('X3', fontsize = 10)
  plt.show()
  </code></pre>