| text | category | heatmap | bar | |
|---|---|---|---|---|
| 0 | one | odd | 10 | 18 |
| 1 | two | even | 20 | 17 |
| 2 | three | odd | 30 | 12 |
| 3 | four | even | 40 | 10 |
| 4 | five | odd | 70 | 5 |
| medal | nation | count | |
|---|---|---|---|
| 0 | gold | South Korea | 24 |
| 1 | gold | China | 10 |
| 2 | gold | Canada | 9 |
| 4 | silver | China | 15 |
| 3 | silver | South Korea | 13 |
| 5 | silver | Canada | 12 |
| 8 | bronze | Canada | 12 |
| 6 | bronze | South Korea | 11 |
| 7 | bronze | China | 8 |
| district | Coderre | Bergeron | Joly | total | winner | result | |
|---|---|---|---|---|---|---|---|
| 0 | 101-Bois-de-Liesse | 2481 | 1829 | 3024 | 7334 | Joly | plurality |
| 1 | 102-Cap-Saint-Jacques | 2525 | 1163 | 2675 | 6363 | Joly | plurality |
| 2 | 11-Sault-au-Récollet | 3348 | 2770 | 2532 | 8650 | Coderre | plurality |
| 3 | 111-Mile-End | 1734 | 4782 | 2514 | 9030 | Bergeron | majority |
| 4 | 112-DeLorimier | 1770 | 5933 | 3044 | 10747 | Bergeron | majority |
adviz.style_table(
election.sort_values('total', ascending=False).head(20),
column_types=['text', 'heatmap', 'heatmap', 'heatmap', 'bar', 'category', 'category'],
column_widths=[.3, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12 ],
precision=0,
theme='plotly_dark',
title='Election Results – Top 20',
height=750,
)top5_gdp_percap = (px.data
.gapminder()
.sort_values(['year', 'gdpPercap'],
ascending=[True, False])
.groupby('year').head().iloc[:, :-2]
[['country', 'continent', 'year', 'gdpPercap', 'lifeExp', 'pop']]
.rename(columns={
'gdpPercap': 'GDP per capita',
'lifeExp': 'Life expectancy',
'pop': 'population'}))
top5_gdp_percap.head()| country | continent | year | GDP per capita | Life expectancy | population | |
|---|---|---|---|---|---|---|
| 852 | Kuwait | Asia | 1952 | 108382.35290 | 55.565 | 160000 |
| 1476 | Switzerland | Europe | 1952 | 14734.23275 | 69.620 | 4815000 |
| 1608 | United States | Americas | 1952 | 13990.48208 | 68.440 | 157553000 |
| 240 | Canada | Americas | 1952 | 11367.16112 | 68.750 | 14785584 |
| 1092 | New Zealand | Oceania | 1952 | 10556.57566 | 69.390 | 1994794 |
See also: the adviz.status_codes chart.
| status | category | |
|---|---|---|
| 0 | 200 | 200 |
| 1 | 200 | 200 |
| 2 | 200 | 200 |
| 3 | 200 | 200 |
| 4 | 200 | 200 |
| ... | ... | ... |
| 414398 | 200 | 200 |
| 414399 | 200 | 200 |
| 414400 | 200 | 200 |
| 414401 | 200 | 200 |
| 414402 | 200 | 200 |
414403 rows × 2 columns
python3 -m pip install adviz
Explore more advertools data visualizations