How to retrieve the cluster centroids in sic-kit learn's K-means?
<p>I'm using this simple script to cluster data using sci-kit learn</p>

<pre><code>from sklearn.cluster import KMeans
import pandas as pd 
import matplotlib.pyplot as plt
X = pd.read_csv('TestData.csv')
est = KMeans(n_clusters=10)
Y = pd.DataFrame(est.fit_predict(X))
frames = [X,Y]
Out = pd.concat(frames, axis = 1)  
</code></pre>

<p>This gives me the following output:</p>

<pre><code>   (feat1) (feat2) (cluster ID) 
0   0.866  1124.182  9
1   2.078  2688.612  1
2   0.000     0.000  0
3   0.000     0.000  0
4   1.038  1344.306  6
5   2.388  3090.338  5
6   0.580   749.456  8
7   1.556  2016.456  2
</code></pre>

<p>I want to also display the centroids for each cluster so that the output looks like:</p>

<pre><code>   (feat1) (feat2) (cluster ID) (centroid 1) (centroid 2)  
0   0.866  1124.182  9
1   2.078  2688.612  1
2   0.000     0.000  0
3   0.000     0.000  0
4   1.038  1344.306  6
5   2.388  3090.338  5
6   0.580   749.456  8
7   1.556  2016.456  2
</code></pre>

<p>I tried using est.cluster_centers_ </p>

<p>But that didn't work. </p>

<p>How can I get the correct cluster centers? </p>