/
gapminder.qmd
49 lines (37 loc) · 971 Bytes
/
gapminder.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
title: "Worldwide Development"
author: "Gapminder Analytics"
format: dashboard
---
```{python}
import plotly.express as px
df = px.data.gapminder()
df = df[df['continent'] != 'Oceania']
```
# Indicators
## Row {height=60%}
```{python}
#| title: GDP and Life Expectancy
px.scatter(
df, x="gdpPercap", y="lifeExp",
animation_frame="year", animation_group="country",
size="pop", color="continent", hover_name="country",
facet_col="continent", log_x=True, size_max=45,
range_x=[100,100000], range_y=[25,90]
)
```
## Row {height=40%}
```{python}
#| title: Population
px.area(df, x="year", y="pop", color="continent", line_group="country")
```
```{python}
#| title: Life Expectancy
px.line(df, x="year", y="lifeExp", color="continent", line_group="country")
```
# Data
![](gapminder.png) Learn more about the Gapminder dataset at <https://www.gapminder.org/data/documentation/>
```{python}
from itables import show
show(df, showIndex = False)
```