> ## Content Index
> Fetch the complete content index at: https://www.bambooweekly.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Bamboo Weekly #91: Roller coasters
- URL: https://www.bambooweekly.com/bw-91-roller-coasters/
- Published: 2024-11-06T16:00:53.000Z
- Updated: 2026-11-07T07:00:07.000Z
- Description: Get better at: web scraping, cleaning data, text encodings, joins, method chaining, and crosstabs.
- Author: Reuven M. Lerner
- Tags: web-scraping, cleaning, encoding, joins, method-chaining, crosstabs, pipe

*\[I'll soon be starting the sixth cohort of my four-month, online* [***Python Data Analytics Bootcamp***](https://pythondab.com/?ref=bambooweekly.com)*. This is the best (and most intensive) course that I offer, giving you a chance to level up your Python and Pandas knowledge with frequent meetings, interactions, and collaboration. Learn more at* [*https://PythonDAB.com*](https://pythondab.com/?ref=bambooweekly.com)*, or join me at a free webinar I'm giving tomorrow (Thursday) at 7 p.m. in Israel, aka 12 noon Eastern:* [*https://store.lerner.co.il/pythondab-6-info-webinar-1*](https://store.lerner.co.il/pythondab-6-info-webinar-1?ref=bambooweekly.com) *. \]*

This week's news has been a bit heavy in both Israel and the US. So I decided not to do the topic that I originally considered, instead looking at something fun and whimsical – roller coasters.

I haven't been on *that* many roller coasters, but do enjoy them, along with other amusement-park rides. So I decided that I'll choose a topic for this week that put a smile on my face, and a pit in my stomach.

# Data and six questions

This week's data comes from RCDB, the Roller Coaster Database, at [https://rcdb.com](https://rcdb.com/?ref=bambooweekly.com) . I had heard of RCDB before, and maybe I had explored it, but ... wow, I might enjoy going on roller coasters every so often, but the people at RCDB take this topic quite seriously.

The data will come partly from RCDB, including its overall location data ([https://rcdb.com/location.htm](https://rcdb.com/location.htm?ref=bambooweekly.com)), along with data about the Wikipedia entry about the G20 countries ([https://en.wikipedia.org/wiki/G20](https://en.wikipedia.org/wiki/G20?ref=bambooweekly.com)).

Here are six tasks and questions. The learning goals for this week include scraping data from Web sites, cleaning data, text encoding, joining, method chaining, and crosstabs.

I'll be back tomorrow with my solutions, including a downloadable Jupyter notebook.

- The "Locations" page at RCDB, [https://rcdb.com/location.htm](https://rcdb.com/location.htm?ref=bambooweekly.com), lists every country and territory, and the number of roller coasters that it has. Create a Pandas data frame from the table on this page. Make the "Location" column the index, and make the "Roller Coasters" column an integer value, treating missing values as 0.
- Three country names came out garbled, with non-alphabetical characters. Which ones? How can we resolve this?
- Which five G20 countries (as listed at [https://en.wikipedia.org/wiki/G20](https://en.wikipedia.org/wiki/G20?ref=bambooweekly.com)) have the most roller coasters, and who are the leaders of these countries? If a country appears more than once (because the list includes both the head of state and head of government), then show only the first one to appear. Remove any numeric footnotes.
- Now create a data frame from data for the United States, at [https://rcdb.com/location.htm?id=59](https://rcdb.com/location.htm?id=59&ref=bambooweekly.com) . Which US states/territories lack any roller coasters at all? What's the total number of people who live in such places?
- California has 97 working roller coasters. Information about its roller coasters are spread across five pages, with the URL pattern `https://rcdb.com/r.htm?page=n&ot=2&ol=1499&ex` (and "n" varies from 1 to 5). Create a single data frame from these five pages, dropping the first (unnamed) column and the "opened" column.
- From those California roller coasters, create a table showing how many working ones are of each type (wood or steel), and how many are of each design.

I'll be back tomorrow with my solutions.

Reuven