Posts

Showing posts from December, 2022

EarthQuake

Image
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 What is going on below? We import libraries to dela with json, reuest from the server and the pandas library. In [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. Then print out what was returned. In [2]: url = 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.geojson' response = requests . get ( url ) response . raise_for_status () Now we need load the data which i

EarthQuake

Image
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 What is going on below? We import libraries to dela with json, reuest from the server and the pandas library. In [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. Then print out what was returned. In [2]: url = 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.geojson' response = requests . get ( url ) response . raise_for_status () Now we need load the data which i