Skip to content

Instantly share code, notes, and snippets.

View ceteri's full-sized avatar

paco xander nathan ceteri

View GitHub Profile
pop_states = usa.merge(state_pop, left_on="NAME", right_on="NAME")
pop_states.head()
state_pop = pd.read_csv("data/nst-est2018-alldata.csv")
state_pop.head()
usa = gpd.read_file("maps/cb_2018_us_state_20m.shp")
usa.head()
import geoplot as gplt
import geopandas as gpd
import geoplot.crs as gcrs
import imageio
import pandas as pd
import pathlib
import matplotlib.pyplot as plt
import mapclassify as mc
import numpy as np
@ceteri
ceteri / geo3.sh
Created May 31, 2020 06:12
Geo 3
wget http://www2.census.gov/programs-surveys/popest/datasets/2010-2018/national/totals/nst-est2018-alldata.csv
mv nst-est2018-alldata.csv data
@ceteri
ceteri / geo2.sh
Created May 31, 2020 06:10
Geo 2
wget https://www2.census.gov/geo/tiger/GENZ2018/shp/cb_2018_us_state_20m.zip
mkdir maps
cd maps
unzip ../cb_2018_us_state_20m.zip
@ceteri
ceteri / geo1.sh
Last active May 31, 2020 06:10
Geo Data article
conda install -c conda-forge geopandas
conda install -c conda-forge geoplot
conda install pysal
@ceteri
ceteri / README.md
Created December 13, 2019 18:48
S3 downloads in Python

Assuming you've installed the AWS SDK for Python:

pip install awscli
pip install boto3

Next, run aws configure on your laptop or server to add your AWS credentials.

For details, see

@ceteri
ceteri / chars.py
Created December 11, 2019 22:02
Python code to handle unicode and codecs properly during CSV => JSON translation
#!/usr/bin/env python
# encoding: utf-8
import codecs
import csv
import json
import unicodedata
filename = "SurveyofDoctorateRecipients_linkages.csv"
#filename = "SurveyofEarnedDoctorates_linkages.csv"
<html>
<head><title>test pdf</title></head>
<div id="pdf"
style="width:900px; height:500px"
></div>
<script src="https://pdfobject.com/js/pdfobject.min.js"></script>
<script>
var options = {
pdfOpenParams: {
page: 1,