+ 4
Pandas Pandas Pandas project help
In DS with python last project, what do we do and how to do it? I have 2 clusters but I’m not understanding the further problem that needs to be solved? Here’s my try: help please n = int(input()) X = [] for i in range(n): X.append([float(x) for x in input().split()]) from sklearn.preprocessing import StandardScaler from sklearn.cluster import KMeans import numpy as np scale = StandardScaler() scale.fit(X) X_scaled = scale.transform(X) kmeans = KMeans(n_clusters=2) kmeans.fit(X_scaled)
7 odpowiedzi
+ 7
Hi,
I solved it, see my profile 😆😆😆
If you like it, please give it a like!!!
https://www.sololearn.com/Profile/14725897
https://code.sololearn.com/cA18A6a7a205/#
+ 1
It's quite easy to misunderstand that task. The explanations to the task are a little bit confusing.
+ 1
Hi!
I’ll offer another decision for you with implemented DS tools (kmeans and numpy)
https://code.sololearn.com/cN83G8vbPnKY/?ref=app
+ 1
No, it actually works on the mobile too. It just crashed on the mobile because I typed the sample input wrong, so I decided to use a PC instead. My fingers and the touch buttons on a mobile are not the best friends.😂
0
Alexandr Bundyuk - -> I tested your code with the "Sample Input" from the explanation of the task, and it actually came out with the same "Sample Output" from the task in the first run, and it was also the same in the second run. I tested it on a PC and not on the mobile.
0
So perhaps it is mobile issue
0
Hirani Pranav you should not use kmeans from sklearn. Just calculate distances and new centroids.