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
#If you've downloaded a bunch of the same type of census file, for example | |
#multiple years of the same data or multiple geography types, and you want to | |
#process them all the same way | |
#works with python3 and python2 | |
import pandas as pd | |
import os | |
#Directories that contain census data downloaded from FactFinder | |
poverty_dir = './census-data/poverty/' |
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
#Big thank you to Mike Stucka for all his help on this one <3 | |
import pandas as pd | |
import requests, time, csv | |
from bs4 import BeautifulSoup | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.common.exceptions import UnexpectedAlertPresentException | |
#fac_data is created from segment.py |
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
#Requires some config: https://github.com/rg3/youtube-dl/blob/master/README.md#readme | |
youtube-dl URL https://www.youtube.com/watch?v=7NcP-KZr7g4 |
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
source ~/.bash_profile |
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
#https://pycodestyle.readthedocs.io/en/latest/ | |
pycodestyle --max-line-length=200 yourdoc.py |
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
#https://www.gdal.org/ogr2ogr.html | |
ogr2ogr -f KML tl_2015_ky_county.kml tl_2015_ky_county.shp |
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
#terminal | |
#h/t @brentajones | |
for i in *; do mv "$i" "$(echo $i|tr A-Z a-z|tr -d " ")"; done |
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
# more info: https://www.gdal.org/ogrinfo.html | |
ogrinfo -so -al geofile.shp | |
############ Example | |
ogrinfo -so -al tl_2015_ky_county.shp | |
output>> | |
INFO: Open of `tl_2015_ky_county.shp' | |
using driver `ESRI Shapefile' successful. |
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
#python2 | |
python -m SimpleHTTPServer 8000 | |
#python3 | |
python -m http.server |
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
https://stackoverflow.com/questions/27517425/apply-vs-transform-on-a-group-object |