0

I have the following dataset:

import pandas as pd

cars = {'Brand': ['Honda Civic','Toyota Corolla','Ford Focus','Audi A4'],
        'Price': [22000,25000,27000,35000],'sales': [220000,250000,270000,350000],'Export': [2000,2000,7000,5000],
        'Speed': [220,210,270,350]
        }

df = pd.DataFrame(cars, columns = ['Brand', 'Price','sales','Export','Speed'])

print (df)

I want to calculate cluster results (calculate centroid and add cluster label) for all possible combinations of features with Kmeans. My question is how to generate all combinations of features to calculate the centroids for cluster=2? Thank you

Qianru Song
  • 331
  • 1
  • 4
  • 16

0 Answers0