Wellbeing
National wellbeing indicators: life expectancy, healthcare spending, life satisfaction, and work hours.
import polars as pl
import polarise
from polarise.datasets import get_wellbeing_data
df = get_wellbeing_data()
Wellbeing heatmap
{ cmap="hawaii" · built-in or cmcrameri }
(df.style()
.heat_map(["Life_Expectancy", "Healthcare_Pct_GDP", "Life_Satisfaction"], cmap="hawaii")
.fashion_minimal()
.title("Wellbeing Indicators by Country")
.show()
)
Wellbeing Indicators by Country
| Country | Life_Expectancy | Healthcare_Pct_GDP | Life_Satisfaction | Work_Hours_Year |
|---|---|---|---|---|
| Spain | 83.3 | 9.1 | 7.1 | 1641 |
| Italy | 82.9 | 9.0 | 6.5 | 1723 |
| France | 82.5 | 11.3 | 6.8 | 1511 |
| Sweden | 83.1 | 10.9 | 7.4 | 1452 |
| Germany | 81.7 | 11.7 | 7.0 | 1349 |
Best and worst life expectancy
{ cmap="orange-to-purple" · built-in }
(df.style()
.highlight_max("Life_Expectancy", fill="lightgreen")
.highlight_min("Life_Expectancy", fill="lightblue")
.gradient("Life_Satisfaction", cmap="orange-to-purple")
.fashion_grid()
.show()
)
| Country | Life_Expectancy | Healthcare_Pct_GDP | Life_Satisfaction | Work_Hours_Year |
|---|---|---|---|---|
| Spain | 83.3 | 9.1 | 7.1 | 1641 |
| Italy | 82.9 | 9.0 | 6.5 | 1723 |
| France | 82.5 | 11.3 | 6.8 | 1511 |
| Sweden | 83.1 | 10.9 | 7.4 | 1452 |
| Germany | 81.7 | 11.7 | 7.0 | 1349 |
Life expectancy vs work hours
(df.style()
.bar("Life_Expectancy", fill="steelblue")
.bar("Work_Hours_Year", fill="#FF6347")
.fashion_compact()
.title("Life Expectancy vs Work Hours")
.footnote("Longer bars = higher values. Red = more work hours.")
.show()
)
Life Expectancy vs Work Hours
| Country | Life_Expectancy | Healthcare_Pct_GDP | Life_Satisfaction | Work_Hours_Year |
|---|---|---|---|---|
| Spain | 83.3 | 9.1 | 7.1 | 1641 |
| Italy | 82.9 | 9.0 | 6.5 | 1723 |
| France | 82.5 | 11.3 | 6.8 | 1511 |
| Sweden | 83.1 | 10.9 | 7.4 | 1452 |
| Germany | 81.7 | 11.7 | 7.0 | 1349 |
Longer bars = higher values. Red = more work hours.