10 points
See the HOWTO page for more details on which dictionaries to setup to solve some of these problems. It includes suggested steps if you don't know how to get started with this assignment. It also has a smaller datafile you can use for testing your program.
We will again provide real earthquake data on the earthquakes around the world that happened for 30 days around October 2016 (this is NEW data). We obtained this data from the U.S. Geological Survey (USGS) EarthQuakes Hazards Program. We've processed the data and put it into an easier format for you to process. You will read the data from our course website. We have included the magnitude and place for each earthquake that happened in this time period. You'll write your program to answer questions about these earthquakes.
EarthquakesPart2.py.
http://www.cs.duke.edu/courses/fall16/compsci101/data/earthquakeDataNov1-2016past30days.txt
Each line of data represents the registering of an earthquake in the format "$magnitude - descriptionOfLocation". For example, here are a few lines from the datafile:
$1.8 - 5km WSW of Volcano, Hawaii $4.9 - 62km E of Namie, Japan $5.2 - 84km SE of Haebaru, Japan $1.1 - 1km SE of The Geysers, California $1.0 - 1km ESE of Mammoth Lakes, California $1.6 - Explosion - 2km SW of Princeton, Canada $4.9 - North Atlantic Ocean $2.2 - 78km NNE of Road Town, British Virgin Islands $-0.1 - 6km SSE of Beatty, Nevada $0.9 - 10km NE of Indio, CA
The first line in the data file represents an earthquake with 1.8 magnitude that occurred 5km WSW of Volcano, Hawaii.
Calculate which base location occurs the most often in the file, and print how many times it occurs.
EarthquakesPart2.py module