Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created February 16, 2021 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/565ee009a74dbe5be81579391909fb75 to your computer and use it in GitHub Desktop.
Save amankharwal/565ee009a74dbe5be81579391909fb75 to your computer and use it in GitHub Desktop.
kmeans = KMeans(n_clusters=6)
data["Cluster"] = kmeans.fit_predict(data)
data["Cluster"] = data["Cluster"].astype("int")
print(data.head())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment