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
curl data.cityofchicago.org/api/views/xzkq-xp2w/rows.csv -s -o salaries.csv | |
cat salaries.csv | sed 's/\$//g' | sort -t , -k 8 -n -r | head -10 | column -s "," -t |
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/env python | |
a = 26.2 # miles in a marathon | |
b = 5 # km in a 5k | |
km_per_mile = 1.61 | |
print(a, "miles is", a * km_per_mile, "km.") | |
print(a, "km is", b * mile_per_km, "miles.") |
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/env python | |
import math | |
import turtle | |
joe = turtle.Turtle() | |
def polygon(joe, size, sides, color): | |
# Use a for loop with fd() and lt() or rt(), |
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
import json | |
with open("narcotics.json") as data: narcotics = json.load(data) | |
offenses = [x['description'] for x in narcotics['objects']] | |
for x in sorted((offenses.count(o), o) for o in set(offenses)): print(x) | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import requests | |
places = [570220, 491527, 570182] | |
req = "https://pleiades.stoa.org/places/{}/json" | |
with open("coords.csv", "w") as out: | |
for p in places: | |
j = requests.get(req.format(p)).json() | |
name = j["names"][0]["romanized"] if j["names"] else None |
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
#!/bin/bash | |
createdb network -O jsaxon -D brobspace | |
sudo -u postgres psql network -c "CREATE EXTENSION postgis; CREATE EXTENSION pgrouting; CREATE EXTENSION postgis_topology;" | |
# Covering the LiveRamp area, all the way to Wisconsin. | |
wget 'http://overpass-api.de/api/interpreter?data=(way["highway"]["highway"!~"pedestrian|footway|steps|path"]["service"!~"parking_aisle|driveway"](41.57,-88.29,42.49,-87.30);>;);out;' -O chicago.osm | |
osm2pgrouting -U jsaxon -d network --f chicago.osm --password MYPASSWD |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/bin/bash | |
# mkdir -p tmp/dec/ | |
cd tmp/dec/ | |
# wget -r ftp://ftp2.census.gov/geo/tiger/PREVGENZ/tr/tr90shp/ | |
# wget -r ftp://ftp2.census.gov/geo/tiger/PREVGENZ/tr/tr00shp/ | |
# wget -r ftp://ftp2.census.gov/geo/tiger/GENZ2010/gz_2010_*_140_00_500k.zip | |
# mv ftp2.census.gov/geo/tiger/PREVGENZ/tr/tr90shp/*zip dec/ | |
# mv ftp2.census.gov/geo/tiger/PREVGENZ/tr/tr00shp/*zip dec/ | |
# mv ftp2.census.gov/geo/tiger/GENZ2010/*zip dec/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer