Pandas Pandas Pandas project help | Sololearn: Learn to code for FREE!


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() X_scaled = scale.transform(X) kmeans = KMeans(n_clusters=2)

12/20/2020 11:03:18 AM

BatOchir Artur

7 Answers

New Answer


Hi, I solved it, see my profile 😆😆😆 If you like it, please give it a like!!!


It's quite easy to misunderstand that task. The explanations to the task are a little bit confusing.


Hi! I’ll offer another decision for you with implemented DS tools (kmeans and numpy)


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.😂


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.


So perhaps it is mobile issue


Hirani Pranav you should not use kmeans from sklearn. Just calculate distances and new centroids.