Datasets / World food and health
Daily calories over time, five countries
Five named countries only, so the lines stay distinguishable. Their different starting points and directions are the comparison; a country missing a year simply has no point there.
How it decided
World food and health: 7,485 rows, 7 columns. country, year and daily_calories for the five named countries.
7,485 rows in, 170 out across 3 columns. Five named countries only, so the lines stay distinguishable. Their different starting points and directions are the comparison; a country missing a year simply has no point there.
line. A shared year axis with one line per country shows divergence and convergence; five lines stay under the eight-line limit.
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.
picked = ["United States", "Australia", "Brazil", "South Africa", "China"]
result = df[df["country"].isin(picked)].dropna(subset=["daily_calories"])[["year", "country", "daily_calories"]].sort_values(["country", "year"])
What it charted
170 rows out of 7,485, 3 columns. First 8 shown.
| year | country | daily_calories |
|---|---|---|
| 1990 | Australia | 3168.569 |
| 1991 | Australia | 3115.3901 |
| 1992 | Australia | 3121.3877 |
| 1993 | Australia | 3042.3596 |
| 1994 | Australia | 3058.0215 |
| 1995 | Australia | 3103.9082 |
| 1996 | Australia | 3082.6638 |
| 1997 | Australia | 3105.7188 |