twoHelixestwoHelixes Start free

Datasets / Iris

Mean sepal length by species

Three groups, one measurement: the comparison the question asks for is a ranking, so it is drawn as one.

Question compare sepal length across species
Mean sepal length by species0246setosaversicolorvirginicaSpecies
Iris — 3 rows charted from 150, drawn as a bar
How it decided
Finding the data85 ms

Iris: 150 rows, 5 columns. species and sepal_length_cm.

Shaping the data9 ms

150 rows in, 3 out across 2 columns. Three groups, one measurement: the comparison the question asks for is a ranking, so it is drawn as one.

Choosing the chart8 ms

bar. A measure across three named groups: bars.

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.

result = df.groupby("species", as_index=False)["sepal_length_cm"].mean()

What it charted

3 rows out of 150, 2 columns. First 3 shown.

speciessepal_length_cm
setosa5.006
versicolor5.936
virginica6.588