twoHelixestwoHelixes Start free

Datasets / Wine recognition

Measurements ranked by spread between cultivars

Each measurement is scored by how far the cultivar means spread relative to the overall mean, so measures on wildly different units can be ranked against each other.

Question which measurements differ most between cultivars?
Measurements that separate the cultivars00.250.50.7511flavanoidscolor_intensityprolineod280/od315_of_di…malic_acidtotal_phenolsproanthocyaninsnonflavanoid_phen…Relative Spread
Wine recognition — 8 rows charted from 178, drawn as a hbar
How it decided
Finding the data81 ms

Wine recognition: 178 rows, 14 columns. every numeric column, grouped by cultivar.

Shaping the data24 ms

178 rows in, 8 out across 2 columns. Each measurement is scored by how far the cultivar means spread relative to the overall mean, so measures on wildly different units can be ranked against each other.

Choosing the chart6 ms

hbar. A ranking of long-named things is a horizontal bar chart. The top eight are shown because the tail carries no signal.

Applying defaults1 ms

Palette, spacing, axis titles and legend placement applied. 0 issues found.

The transformation

This is the code, not a description of it — the chart above was drawn from what it returns, and the notebook download runs the same lines against the same file.

means = df.groupby("cultivar").mean(numeric_only=True)
spread = (means.max() - means.min()) / means.mean().abs()
result = (
    spread.sort_values(ascending=False).head(8)
    .rename("relative_spread").reset_index()
    .rename(columns={"index": "measurement"})
)

What it charted

8 rows out of 178, 2 columns. First 8 shown.

measurementrelative_spread
flavanoids1.1297
color_intensity0.8075
proline0.7896
od280/od315_of_diluted_wines0.5799
malic_acid0.5776
total_phenols0.5141
proanthocyanins0.4777
nonflavanoid_phenols0.4291