twoHelixestwoHelixes Start free

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.

Question how have daily calories trended in five countries?
Daily calories per person, five countries01k2k3k4k19901992199419961998200020022004200620082010201220142016201820202022YearUnited StatesAustraliaBrazilChinaSouth Africa
World food and health — 170 rows charted from 7,485, drawn as a line
How it decided
Finding the data15 ms

World food and health: 7,485 rows, 7 columns. country, year and daily_calories for the five named countries.

Shaping the data13 ms

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.

Choosing the chart13 ms

line. A shared year axis with one line per country shows divergence and convergence; five lines stay under the eight-line limit.

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.

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.

yearcountrydaily_calories
1990Australia3168.569
1991Australia3115.3901
1992Australia3121.3877
1993Australia3042.3596
1994Australia3058.0215
1995Australia3103.9082
1996Australia3082.6638
1997Australia3105.7188