Last active
June 28, 2020 19:47
-
-
Save deeagle/42eeb457024a083ee13eee885a9e6901 to your computer and use it in GitHub Desktop.
Simple example do get data from an URL into python pandas in a jupiter notebook.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import pandas as pd | |
import urllib | |
# the url of the data resource | |
url = "https://data.seattle.gov/resource/6vkj-f5xf.csv" | |
# the name of the local file to store the data from the url | |
seattle_inventory_filename = "seattle-inventory.csv" | |
# get the file from the url and save it as file | |
urllib.request.urlretrieve(url, seattle_inventory_filename) | |
# load the csv into pandas (pandas -> tool to work with tables) | |
data_frame = pd.read_csv(seattle_inventory_filename) | |
# show the first table columns | |
data_frame.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mit deinen Schritt-für-Schritt-Erläuterungen verstehe ich es dann auch mal. well done