Skip to content

Instantly share code, notes, and snippets.

Avatar

Abraham Flaxman aflaxman

View GitHub Profile
View gist:31cd0a65ef5627585fb8
{
"metadata": {
"name": "",
"signature": "sha256:53400d77ba7c32c0cc425b9c26b94a2bf7c3ed3c199a7b07c9c6526e9d844d8d"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
View README.md

Interactive graphic by Christopher Ingraham.

Source: American Community Survey 2012.

Last week this graphic of migration flows by Chris Walker made the rounds. Many commenters noted how beautiful the graphic is, and rightly so.

I always have a bit of a hard time parsing exactly what's going on within these Circos-style visualizations. Walker's graphic allows you to hover over a given state to highlight only those migrations, which helps quite a bit.

I thought there might be a better way to display these data, but I wasn't right. I stuck with a map, drawing circles for each state sized by net migration (comings minus goings) and colored according to whether the state gained or lost residents overall. To get at individual state flows, click a state - paths radiate inwards and outwards fr

View file1.py
{
"metadata": {
"name": "2013_04_20b_hello_d3-vega-vincent"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
View ipynb_style.py
import IPython.core.display
import matplotlib as mpl
def clean():
# set mpl defaults for nice display
mpl.rcParams['font.size'] = 12
mpl.rcParams['figure.figsize'] = (18, 6)
mpl.rcParams['lines.linewidth'] = 1
@aflaxman
aflaxman / exp_sum_pymc.ipynb
Created Nov 6, 2012 — forked from Tillsten/exp_sum_pymc.py
Fit to an expontial sum in pymc
View exp_sum_pymc.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View history_steps.py
import pymc as pm
import numpy as np
# FIXME: Need to store duplicates too, when jumps are rejected. That means some mechanism
# for making sure the history is full-rank needs to be employed.
class HistoryCovarianceStepper(pm.StepMethod):
_state = ['n_points','history','tally','verbose']
You can’t perform that action at this time.