Session 3, #5: Additional Challenges: Labeling Earthquakes


These are engaging exercises that are not needed for the flow of the course but for students who finished the first parts early.

The USGS data also includes the location of the earthquake in the column after the 13th comma:

obsData = '2017-01-17T11:48:48.530Z,5.4319,94.6079,54.55,5.6,mb,,67,2.338,1,us,us10007tps,2017-01-17T12:14:46.732Z,"80km W of Banda Aceh, Indonesia",earthquake,7.4,5.8,0.045,173,reviewed,us,us' We can locate that in a similar way to getting latitude and longitude. Since we want words (and not numbers as we did for latitude and longitude), it is a bit easier:

			columns = line.split(',')
			location = columns[13]
		



Challenge: Mark the three earthquakes with their locations, using the write() command:

        thea.write(location, None, None, "16pt bold")