Skip to content

Instantly share code, notes, and snippets.

@deeagle
Last active June 28, 2020 19:47
Show Gist options
  • Save deeagle/42eeb457024a083ee13eee885a9e6901 to your computer and use it in GitHub Desktop.
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.
#!/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()
@janamandrys
Copy link

Mit deinen Schritt-für-Schritt-Erläuterungen verstehe ich es dann auch mal. well done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment