import polars as plfrom great_tables import GT, md, htmlfrom great_tables.data import islandsislands_mini = ( pl.from_pandas(islands).sort("size", descending=True) .head(10))( GT(islands_mini) .tab_header( title="Large Landmasses of the World", subtitle="The top ten largest are presented" ) .tab_stub(rowname_col="name") .tab_source_note(source_note="Source: The World Almanac and Book of Facts, 1975, page 406.") .tab_source_note( source_note=md("Reference: McNeil, D. R. (1977) *Interactive Data Analysis*. Wiley.") ) .tab_stubhead(label="landmass") .fmt_integer(columns="size"))
Large Landmasses of the World
The top ten largest are presented
landmass
size
Asia
16,988
Africa
11,506
North America
9,390
South America
6,795
Antarctica
5,500
Europe
3,745
Australia
2,968
Greenland
840
New Guinea
306
Borneo
280
Source: The World Almanac and Book of Facts, 1975, page 406.
Reference: McNeil, D. R. (1977) Interactive Data Analysis. Wiley.
Show the Code
from great_tables import GT, htmlfrom great_tables.data import airqualityairquality_mini = airquality.head(10).assign(Year =1973)( GT(airquality_mini) .tab_header( title="New York Air Quality Measurements", subtitle="Daily measurements in New York City (May 1-10, 1973)" ) .tab_spanner( label="Time", columns=["Year", "Month", "Day"] ) .tab_spanner( label="Measurement", columns=["Ozone", "Solar_R", "Wind", "Temp"] ) .cols_move_to_start(columns=["Year", "Month", "Day"]) .cols_label( Ozone = html("Ozone,<br>ppbV"), Solar_R = html("Solar R.,<br>cal/m<sup>2</sup>"), Wind = html("Wind,<br>mph"), Temp = html("Temp,<br>°F") ))
New York Air Quality Measurements
Daily measurements in New York City (May 1-10, 1973)
Time
Measurement
Year
Month
Day
Ozone, ppbV
Solar R., cal/m2
Wind, mph
Temp, °F
1973
5
1
41.0
190.0
7.4
67
1973
5
2
36.0
118.0
8.0
72
1973
5
3
12.0
149.0
12.6
74
1973
5
4
18.0
313.0
11.5
62
1973
5
5
14.3
56
1973
5
6
28.0
14.9
66
1973
5
7
23.0
299.0
8.6
65
1973
5
8
19.0
99.0
13.8
59
1973
5
9
8.0
19.0
20.1
61
1973
5
10
194.0
8.6
69
Show the Code
from great_tables import GTfrom great_tables.data import countrypopsimport polars as plimport polars.selectors as cs# Get vectors of 2-letter country codes for each region of Oceaniaoceania = {"Australasia": ["AU", "NZ"],"Melanesia": ["NC", "PG", "SB", "VU"],"Micronesia": ["FM", "GU", "KI", "MH", "MP", "NR", "PW"],"Polynesia": ["PF", "WS", "TO", "TV"],}# Create a dictionary mapping country to region (e.g. AU -> Australasia)country_to_region = { country: region for region, countries in oceania.items() for country in countries}wide_pops = ( pl.from_pandas(countrypops) .filter( pl.col("country_code_2").is_in(list(country_to_region))& pl.col("year").is_in([2000, 2010, 2020]) ) .with_columns(pl.col("country_code_2").replace(country_to_region).alias("region")) .pivot(index=["country_name", "region"], on="year", values="population") .sort("2020", descending=True))( GT(wide_pops) .tab_header(title="Populations of Oceania's Countries in 2000, 2010, and 2020") .tab_spanner(label="Total Population", columns=cs.all()) .tab_stub(rowname_col="country_name", groupname_col="region") .fmt_integer())
Populations of Oceania's Countries in 2000, 2010, and 2020
2023 Mean Carbon Intensity (gCO2eq/kWh) and Power Consumption Breakdown (%)
Zone
CO2 Intensity
Hydro
Nuclear
Wind
Solar
Geothermal
Biomass
Gas
Coal
Oil
Unknown
Hydro Discharge
Battery Discharge
Sweden
26
39.1%
26.8%
27.7%
0.1%
0.0%
0.4%
0.4%
0.8%
0.0%
4.6%
0.1%
0.0%
Iceland
28
69.4%
0.0%
0.0%
0.0%
30.6%
0.0%
0.0%
0.0%
0.0%
0.0%
0.0%
0.0%
Quebec
35
90.1%
2.1%
4.4%
0.0%
0.0%
1.9%
1.4%
0.0%
0.0%
0.0%
0.0%
0.0%
France
46
12.3%
65.4%
10.3%
1.8%
0.0%
1.0%
7.1%
0.3%
0.3%
0.1%
1.4%
0.0%
Ontario
104
23.3%
49.4%
8.7%
0.1%
0.0%
0.2%
18.1%
0.0%
0.0%
0.0%
0.0%
0.0%
New Zealand
106
60.5%
0.0%
7.7%
0.1%
19.0%
0.0%
6.8%
3.7%
0.0%
2.2%
0.0%
0.0%
Finland
107
20.2%
36.5%
24.1%
0.1%
0.0%
6.2%
3.0%
8.1%
0.0%
1.8%
0.0%
0.0%
South Australia
132
0.7%
0.0%
42.6%
33.7%
0.0%
0.0%
13.3%
9.0%
0.0%
0.0%
0.0%
0.7%
Spain
132
17.1%
24.2%
25.1%
8.0%
0.0%
2.0%
18.8%
1.3%
0.2%
0.3%
3.0%
0.0%
Belgium
147
1.3%
39.6%
25.2%
3.6%
0.0%
2.8%
19.4%
1.7%
0.1%
4.9%
1.2%
0.0%
Tasmania
162
49.0%
0.0%
22.6%
10.8%
0.0%
0.0%
1.5%
16.1%
0.0%
0.0%
0.0%
0.0%
East Denmark
184
6.4%
5.5%
48.4%
1.3%
0.0%
16.8%
7.7%
10.8%
1.4%
1.4%
0.4%
0.0%
West Denmark
188
8.8%
2.2%
56.3%
1.6%
0.0%
7.6%
8.5%
13.0%
0.9%
0.4%
0.6%
0.0%
Great Britain
214
3.8%
12.4%
35.9%
2.7%
0.0%
6.2%
35.1%
2.0%
0.0%
1.0%
1.0%
0.0%
Netherlands
218
1.1%
3.9%
46.7%
10.8%
0.0%
4.6%
22.4%
8.6%
0.8%
1.1%
0.2%
0.0%
New York ISO
275
23.7%
22.8%
4.9%
0.0%
0.0%
0.1%
46.9%
0.0%
0.0%
1.6%
0.0%
0.0%
Italy (North)
307
22.7%
14.5%
3.9%
2.9%
0.2%
3.1%
38.4%
1.5%
0.2%
9.3%
3.3%
0.0%
California
328
8.4%
12.7%
7.9%
12.0%
3.0%
1.8%
48.5%
2.1%
0.0%
1.2%
0.0%
2.6%
Germany
389
4.4%
2.8%
39.7%
3.3%
0.0%
8.7%
14.4%
23.3%
0.6%
0.6%
2.1%
0.0%
Ireland
389
3.7%
0.8%
38.5%
0.2%
0.0%
2.5%
42.4%
9.7%
2.0%
0.1%
0.1%
0.0%
Western Australia
417
0.0%
0.0%
14.1%
33.8%
0.0%
0.3%
24.2%
27.1%
0.3%
0.0%
0.0%
0.3%
Texas
432
0.0%
9.1%
22.3%
6.0%
0.0%
0.0%
46.1%
16.1%
0.0%
0.4%
0.0%
0.0%
Alberta
447
1.9%
0.0%
12.4%
1.1%
0.0%
2.5%
70.7%
7.2%
0.0%
4.1%
0.0%
0.0%
Victoria
508
3.9%
0.0%
17.5%
19.0%
0.0%
0.0%
0.3%
59.1%
0.0%
0.0%
0.0%
0.2%
New South Wales
578
3.2%
0.0%
9.5%
23.7%
0.0%
0.2%
0.7%
62.6%
0.0%
0.0%
0.0%
0.1%
Queensland
662
1.9%
0.0%
3.8%
21.1%
0.0%
0.0%
7.2%
65.7%
0.2%
0.0%
0.0%
0.1%
South Africa
685
2.2%
4.3%
5.8%
3.8%
0.0%
0.0%
0.0%
79.9%
2.0%
0.1%
2.0%
0.0%
India (North)
693
9.3%
2.2%
0.1%
10.6%
0.0%
0.0%
1.8%
75.2%
0.0%
0.9%
0.0%
0.0%
Source: api.electricitymap.org | Methodology: https://www.electricitymaps.com/methodology. Some emissions factors are based on IPCC 2014 defaults, while some are based on more accurate regional factors. All zones are publicly available on the Carbon intensity and emission factors tab via Google docs link