I have a question about kmeans clustering in python.
So I did the analysis that way:
from sklearn.cluster import KMeans km = KMeans(n_clusters=12, r
Assuming the column length is as the same as each column in you dataframe df, all you need to do is this:
df
df['NEW_COLUMN'] = pd.Series(predict, index=df.index)