text_plain_output_1.png
from sklearn.cluster import KMeans

import matplotlib.pyplot as plt

import pandas as pd

df = pd.read_csv('../input/whisky.csv')

dist = []
for i in range(2, 20):
    km = KMeans(n_clusters=i, n_init=10, max_iter=500, random_state=0)
    km.fit(df.iloc[:, 2:-3])
    dist.append(km.inertia_)
plt.plot(range(2, 20), dist)
plt.show()