Earthquakes in a month (now with code)
Earthquake Start of a project to bring in information from a website with an Application Programming Interface (API). We are going to use a modified version of "Project: Fetching Current Weather Data" from "Automate the boring stuff with Python" by Al Sweigart Instead of weather data were are collecting a month's worth of earthquake data. What is going on below? We import libraries to deal with json, request from the server and the pandas library. [1]: import json , requests import pandas as pd from pandas import json_normalize In this section we creating a string made up of the URL. Requesting the information from the site with the URL we created and pass back the information. Data comes from the US Geological survey https://www.usgs.gov/about/about-us/who-we-are and one of their earthquake feeds. Requesting the information from the site with the URL we created and pass back the information. Then print out what was returned. [2]: url = 'https:...
Comments
Post a Comment