Sign inCreate account
Guided Projects / Green on Paper โ€” The Verdant Union: Six Green Claims
๐Ÿงญ PROJECT BRIEF

Green on Paper โ€” The Verdant Union: Six Green Claims

Beginner Environment ๐Ÿ•’ ~24 hours ๐Ÿ“ฆ 0+ published takes

The Verdant Union has published a Green Progress Report with six claims: carbon dioxide down since 2016, tens of thousands of megawatts of new renewable capacity, a recycling rate of 45.1, industry using less water, cleaner air in its largest city, and green projects that cut millions of tonnes a year. Every number in it is arithmetically true. Your job is to find out what each one means.

Work through the seventeen tasks with the book Green on Paper beside you: each task follows one chapter, and each chapter ends with a Try It box that describes the same task. Learn Python from zero, read the twelve tables with pandas, ask them the questions each claim raises (which years, capacity or output, whose average, which sector, better than what, claimed by whom), find what is wrong with the data, clean it in code with a log of every decision, and build the scorecard. Then chart the answers and write each claim the way it should have been written.

The project is one notebook for the whole book. Add each chapter's Python blocks below the previous chapter's, in order, and assign them to that chapter's task. The tables are loaded under their file names: pd.read_csv("data/carbon_emissions.csv") works as in the book, and lp.table("carbon_emissions") is a shortcut. Later tasks use names made by earlier ones (the twelve tables from Task 3, air["Month"] from Task 8, the clean tables and cleaning_log from Task 11, scorecard from Task 12), so keep the blocks that make a name above the blocks that use it. Each task asks you to make a variable of your own, and its automatic check reads it. Python names live in the browser session: after reopening the project, press Run all before running anything else, so that every earlier block rebuilds what later blocks use.

You need no Python to start: the book teaches it from the first line. Your notebook is the deliverable: assign every block to its task, write the notes each task asks for, run the automatic checks, press Run all until it passes from top to bottom, and submit.

๐Ÿงช Runs in your browser
Dataset โ†’ Profile โ†’ Clean โ†’ SQL โ†’ Chart โ†’ Quality โ†’ Python โ†’ Output

Real SQL (DuckDB) and real Python (pandas) run entirely in your browser โ€” nothing to install, and your data never leaves it. โ–ถโ–ถ Run all replays the whole notebook top-to-bottom; a clean pass marks the published repo as reproducible โ›“.

โ˜‘๏ธ The tasks

01
Count the air readings
Chapter 1. Run the chapter's first look at the claims in a Python block. Then read the air quality file into a DataFrame and make rows_air, the number of rows it holds (len of a DataFrame is its number of rows); the check reads rows_air. Ten cities measured monthly from January 2018 to December 2023 would give 720 rows. In a note, write one sentence on what could make the count differ from 720, and why the count alone cannot tell you how many rows are missing. Assign the blocks to Task 1.
02
Read a file without pandas
Chapter 2. Run the chapter's blocks in order: values, names, lists, dictionaries, loops, functions and the errors. Then build city_pop, a dictionary from each city's name to its population in thousands as an int, by reading data/cities.csv with csv.DictReader and a loop, not by typing. Print each city over one million people with its share of the ten cities' total, in percent with one decimal. The check adds up the dictionary's values, which works only if all ten cities are there as numbers. In a note, say what a colleague could check in your code that a spreadsheet SUM would not show. Assign the blocks to Task 2.
03
Load the twelve tables and count what is missing
Chapter 3. Run the chapter's code in order. It reads the twelve tables under the names the rest of the book uses (production, consumption, adoption, projects, emissions, water, waste, population, air, practices, programs, cities) and turns the CO2 column of emissions into numbers; later tasks rely on these names. Then make air_missing, a Series holding the number of missing values in each column of air as read with the defaults, and read the same file again under another name with keep_default_na=False to find which missing PM2.5 cell was not blank in the file. The check reads the PM2.5 count of air_missing. Assign the blocks to Task 3.
04
List the non-compliant projects
Chapter 4. Run the chapter's code below Chapter 3's. Then make noncompliant: every project marked Non-Compliant outside Dovrena, with the columns Project_ID, Region and Carbon_Emission_Reduction_MT, largest claim first. Use a mask with two conditions, a list of columns and sort_values, and leave projects unchanged. The check counts its rows. In a note, say what share of the listed claims comes from the largest one. Assign the blocks to Task 4.
05
Compute a rate from totals
Chapter 5. Run the chapter's code below Chapter 4's. Then make recycling_rate_2015: the Union's recycling rate in 2015, in percent, as the recycled tonnes of every 2015 row divided by the generated tonnes of the same rows. The check rounds it to one decimal; an average of the row rates gives another number and fails. In a note, state the rise from 2015 to 2022 both in percentage points and in percent. Assign the blocks to Task 5.
06
Recycling by country
Chapter 6. Run the chapter's code below Chapter 5's. Then make recycling_2022: a Series of the 2022 recycling rate, in percent, by country, each rate computed as the country's recycled tonnes over its generated tonnes. The check reads Coralis, rounded to one decimal; an average of Coralis's five waste-type rates gives another number and fails. In a note, write the two sentences a report could print: the Union's rate, and the average member country's. Assign the blocks to Task 6.
07
Emissions per person by country
Chapter 7. Run the chapter's code below Chapter 6's. Then make co2_per_person_2022, a Series of each country's CO2 per person in 2022, in tonnes, indexed by country name: start from emissions and population, clean the country names on a copy before the merge, and check the merge with indicator=True or validate. The check reads Coralis, rounded to two decimals, which is right only if the lower-case coralis row was repaired before the merge. Assign the blocks to Task 7.
08
Oxmere by month
Chapter 8. Run the chapter's code below Chapter 7's; it reads each station's dates in its own format into air["Month"], which later tasks use. Then make oxmere_by_month, a Series of Oxmere's mean PM2.5 for each calendar month, indexed by the month number 1 to 12, using air["Month"]. The check is the difference between Oxmere's January and July, rounded to one decimal, which exists only if Oxmere's dates were read day first. In a note, say why a claim comparing a winter month with a summer month misleads. Assign the blocks to Task 8.
09
CO2-equivalent with other GWPs
Chapter 9. Run the chapter's code below Chapter 8's; it adds the column CO2e_Tonnes to emissions with the AR5 values in GWP. Then recompute the Union's 2022 emissions by sector with the AR6 values (methane 27, nitrous oxide 273, CO2 1): make ar6_by_sector, a Series of 2022 CO2-equivalent in million tonnes by sector, without changing emissions or GWP. The check reads Agriculture, rounded to one decimal. In a note, say why agriculture moves when the Union's total barely does. Assign the blocks to Task 9.
10
Three more rules
Chapter 10. Run the chapter's code below Chapter 9's; it builds rule_checks, the table of fifteen rules. Then make more_rules, a DataFrame with the same three columns as rule_checks (table, rule, rows_failing), holding three rules the chapter found faults for but did not record: air Location is a city in cities; sustainability_practices Reported Savings (kWh) is a number; efficiency_programs Participants is a number (write the last two like the PM10 rule). Do not change rule_checks. The check adds up rows_failing. Assign the blocks to Task 10.
11
Change one cleaning decision
Chapter 11. Run the chapter's code below Chapter 10's; it builds the clean tables (emissions_clean and the rest) and cleaning_log, which later tasks use. Then change one decision and measure it: build emissions_alt, the same cleaning of emissions as the chapter, except that the conflicting Estmark 2021 industry rows keep the first row instead of the later one. The check reads emissions_alt's 2021 CO2 total in million tonnes, rounded to one decimal. In a note, write the cleaning log line your version needs. Assign the blocks to Task 11.
12
A seventh check on the first claim
Chapter 12. Run the chapter's code below Chapter 11's; it builds scorecard, which later tasks use. Then make co2_per_person, a Series indexed by year: the Union's carbon dioxide in tonnes from emissions_clean, divided by the Union's population in people from population (its column is in millions). The check reads 2022, rounded to two decimals. In a note, say whether emissions per person tell a better or a worse story than the total. Assign the blocks to Task 12.
13
Save the air quality chart
Chapter 13. Run the chapter's code below Chapter 12's; the charts appear under their blocks. Then make the chart of 2023 PM2.5 by city your own: horizontal bars, the WHO guideline of 5 as a reference line, the excess in amber, a title that states the finding and an axis label with the unit. Create it with figsize=(6.5, 3.6), save it as output/pm25_2023.png with dpi=150 (no bbox_inches), and read it back with pm25_png = plt.imread("output/pm25_2023.png"). The check reads the width of the image in pixels. Assign the blocks to Task 13.
14
The Union's intensity claim
Chapter 14. Run the chapter's code below Chapter 13's. Then make Dovrena's intensity claim for the whole Union: create union_intensity, a Series indexed by year of the Union's energy-sector CO2 divided by the Union's electricity produced (from production_clean), in tonnes per GWh, and compute the change in it and in the energy sector's absolute CO2 from 2015 to 2022. The check reads 2022, rounded to a whole number. In a note, write the honest sentence. Assign the blocks to Task 14.
15
A location-based Scope 2
Chapter 15. Run the chapter's code below Chapter 14's. Then make grid_factor, a DataFrame with one row per year (2015 to 2022) and one column per country, holding the Energy sector's CO2 in tonnes per GWh produced. Use it to make brisland_scope2, a Series by year of the location-based Scope 2, in tonnes, of a company that used 250 GWh every year in Brisland. The check is the ratio of 2020 to 2019, rounded to two decimals. In a note, write one sentence on what the company did to cause that change. Assign the blocks to Task 15.
16
Reproduce from the raw data
Chapter 16. Run the chapter's code below Chapter 15's. Then run check 1 on the renewable share of electricity: make share_raw, a Series by year of the renewable share (percent of all GWh produced) computed on the raw production table with its own Renewable column, and share_clean, the same on production_clean. Print them side by side, and in a note name, for each year that differs, the fault that explains it. The check is the largest gap between the two, rounded to one decimal. Assign the blocks to Task 16.
17
Air weighted by people, and submit
Chapter 17. Run the chapter's code below Chapter 16's. Then make pm25_simple, a Series by year (2018 to 2023) of the plain mean of the ten cities' yearly PM2.5, and pm25_exposure, the same weighted by each city's population from cities. Chart both as lines on one axis, and in a note write a one-sentence claim about the air the Union's city dwellers breathe that survives items 3 and 6 of the chapter. The check is the gap between the two in 2023, rounded to one decimal. Then press Run all until the notebook passes from top to bottom, and submit with a one-line description. Assign the blocks to Task 17.