For df games lasting at least 20 minutes, inspect the distribution of minutes using a KDE with cut=0 and bw_adjust=1.
The editable setup on the right creates df. Run executes the setup and your work from top to bottom.
Your requirements
- Treat its shape as exploratory.
- Chart: title "Board games"; x "minutes"; y "Density".
Read the result: Would these few observations justify a claim about the population’s modes?
Your inputs
| game | genre | minutes | rating | players |
|---|---|---|---|---|
| Orbit | Strategy | 20 | 4.1 | Two |
| Tiles | Puzzle | 15 | 3.8 | Solo |
| Quest | Adventure | 60 | 4.7 | Two |
| Grove | Strategy | 35 | 4.4 | Solo |
| Castle | Adventure | 45 | 4.5 | Two |
| Cards | Puzzle | 10 | 3.6 | Solo |
Remember the idea
A kernel density estimate (KDE) smooths observations into a curve. Its height is density, not a count or a probability at one exact value.
A small example
Increasing bw_adjust from 1 to 2 makes bumps wider and the combined curve smoother; it does not add observations.
| Code or choice | Meaning |
|---|---|
bw_adjust=1 | Use the default smoothing bandwidth. Larger values smooth more; smaller values reveal more bumps. |
cut=0 | Stop drawing at the observed minimum and maximum. |
sns.kdeplot(..., x="value", ax=ax) | Draw a smoothed view of a numeric column. |
Hint
Choose the observations first, then map the requested measurements to the chart.
Reveal solution
One way to do it. Keep any supplied setup in the editor and use this in the Your work section.
import matplotlib.pyplot as plt
import seaborn as sns
fig, ax = plt.subplots(figsize=(6, 4))
selected = df[df["minutes"] >= 20]
sns.kdeplot(data=selected, x="minutes", cut=0, bw_adjust=1, ax=ax)
ax.set(title="Board games", xlabel="minutes", ylabel="Density")
fig.tight_layout()
plt.show()