Skip to content
Snippets Groups Projects
Commit ffce38e0 authored by gsingh58's avatar gsingh58
Browse files

lec6 updated

parent 0436dacd
No related branches found
No related tags found
No related merge requests found
Pipeline #743928 passed
File added
File added
import requests # pip3 install requests
url = "https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2021-10-21&endtime=2021-11-22"
resp = requests.get(url)
resp.raise_for_status()
quake_dicts = []
for row in resp.json()["features"]:
quake_dicts.append({
"place": row["properties"]["place"],
"time": row["properties"]["time"],
"mag": row["properties"]["mag"],
"loc": {"lat": row["geometry"]["coordinates"][1],
"lon": row["geometry"]["coordinates"][0]}
})
print(quake_dicts)
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment