Question
Need use python to write the code. Write a program that reads the earthquake data.txt, and to process the earthquake data file and create lists
Need use python to write the code.
Write a program that reads the earthquake data.txt, and to process the earthquake data file and create lists of earthquake magnitudes and their dates, one for each region. Your function should return a list of lists that looks like the following: [region, [date1, magnitude1], [date2, magnitude2], [date3, magnitude3], ]
Examples of output:
[ALASKA, [2006/10/19, 2.8], [2006/10/18, 2.6], [2006/10/18, 2.7], [2006/10/18, 2.7], [2006/10/18, 2.8]]
[MEXICO, [2006/10/20, 2.8], [2006/10/18, 3.3]]
earthquake data txt:
2.8 2006/10/19 02:02:10 62.391 -149.751 15.0 CENTRAL ALASKA 2.5 2006/10/19 00:31:15 20.119 -156.213 1.5 MAUI REGION, HAWAII 5.0 2006/10/18 21:15:51 4.823 -82.592 37.3 SOUTH OF PANAMA 2.6 2006/10/18 21:12:25 59.934 -147.904 30.0 GULF OF ALASKA 3.4 2006/10/18 20:59:21 36.540 -89.640 7.7 SOUTHEASTERN MISSOURI 2.7 2006/10/18 20:11:22 61.023 -151.418 60.0 SOUTHERN ALASKA 3.1 2006/10/20 16:40:15 20.282 -156.611 4.7 MAUI REGION, HAWAII 2.7 2006/10/18 14:12:19 59.808 -152.538 50.0 SOUTHERN ALASKA 2.8 2006/10/18 14:02:12 60.686 -151.871 90.0 KENAI PENINSULA, ALASKA 4.9 2006/10/20 12:10:01 1.758 127.488 127.0 HALMAHERA, INDONESIA 6.2 2006/10/18 10:45:36 -15.081 167.243 138.5 VANUATU 2.8 2006/10/20 10:45:17 32.162 -115.895 6.3 BAJA CALIFORNIA, MEXICO 3.3 2006/10/18 10:08:45 32.165 -115.891 7.3 BAJA CALIFORNIA, MEXICO
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started