> ## 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 #3: Earthquake
- URL: https://www.bambooweekly.com/earthquake/
- Published: 2023-02-15T16:01:23.000Z
- Updated: 2026-08-06T10:46:11.000Z
- Description: Get practice working with CSV files, working with datetime values, string values, and cleaning data.
- Author: Reuven M. Lerner
- Tags: csv, datetime, strings, cleaning

## This week’s topic: Earthquakes

There’s always a lot of news going on, but one of the biggest, and most horrifying, stories from the last few weeks is the [massive earthquake that affected Turkey and Syria](https://en.wikipedia.org/wiki/2023%5FTurkey%E2%80%93Syria%5Fearthquake?ref=bambooweekly.com), with the initial shock taking place on February 6th. As of this writing, more than 40,000 people have died; I can only begin to imagine the even greater number who are now injured, homeless, or out of work.

The reports that I’ve been reading led me to wonder: How frequently do earthquakes occur? How strong are they normally? Was this one unusually strong?

For this week’s newsletter, I decided to dig into information about earthquakes. The [US Geological Survey](https://www.usgs.gov/?ref=bambooweekly.com), a scientific research agency that’s part of the Department of the Interior, [offers many tools and data sets for anyone interested in learning more about this subject](https://www.usgs.gov/programs/earthquake-hazards/data?ref=bambooweekly.com).

For this week’s data, I went to the USGS page that lets you [search their earthquake catalog](https://earthquake.usgs.gov/earthquakes/search/?ref=bambooweekly.com#{%22feed%22%3A%221437493916387%22%2C%22search%22%3A{%22id%22%3A%221437493916387%22%2C%22name%22%3A%22Search%20Results%22%2C%22isSearch%22%3Atrue%2C%22params%22%3A{%22producttype%22%3A%22losspager%22%2C%22orderby%22%3A%22time%22}}%2C%22listFormat%22%3A%22losspager%22%2C%22sort%22%3A%22newest%22%2C%22basemap%22%3A%22grayscale%22%2C%22autoUpdate%22%3Afalse%2C%22restrictListToMap%22%3Atrue%2C%22timeZone%22%3A%22utc%22%2C%22mapposition%22%3A[[-85%2C0]%2C[85%2C360]]%2C%22overlays%22%3A{%22plates%22%3Atrue}%2C%22viewModes%22%3A{%22map%22%3Atrue%2C%22list%22%3Atrue%2C%22settings%22%3Atrue%2C%22help%22%3Afalse}}). I chose to see earthquakes with a minimum magnitude of 2.5, between January 1st, 2000 and today (February 15, 2023). I asked to see all data, from all all over the world. I chose the CSV output option, and ended up with the following URL:

[https://earthquake.usgs.gov/fdsnws/event/1/query.csv?starttime=2000-01-01%2000:00:00&endtime=2023-02-15%2000:00:00&minmagnitude=2.5&orderby=time&producttype=losspager](https://earthquake.usgs.gov/fdsnws/event/1/query.csv?starttime=2000-01-01%2000:00:00&endtime=2023-02-15%2000:00:00&minmagnitude=2.5&orderby=time&producttype=losspager&ref=bambooweekly.com)

That gives us a data set of more than 8,000 earthquakes from all over the world, for more than 20 years, which should be enough to ask and answer some interesting questions:

- Read the downloaded CSV file (which will be called \`query.csv\`, but which I renamed to \`earthquake-data.csv\` on my computer) into Pandas.
- How many seismic events take place each year? In which of the last 20 years did we have the greatest number of such events?
- What are common magnitudes? Looking only at the integer portion of the magnitudes, how often does each value occur?
- How many seismic events took place in Turkey on February 6th? What was their average magnitude? What was the mean magnitude?
- Are earthquakes common in Turkey? From the "place" column, extract the text following the final comma, and get the 30 most common places in the world with earthquakes.
- Are serious earthquakes common in Turkey? Rerun the previous query, but only look for those with a magnitude of 5 or greater.

The learning goals for this week’s questions are to work with time information, work with strings, and handle some missing data.

Too easy? Too hard? Too few hints? Let me know! I’m still trying to figure out the appropriate type(s) of questions to ask in this newsletter, and any/all feedback is welcome.

I’ll be back tomorrow (on Thursday) with my answers to these questions.

Reuven