Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
import matplotlib.pyplot as plt
# Import Data
data = pd.read_csv('scrubbed.csv')
data.head()
#Prepare "shapes" column for donut plot entry
shapes = data['shape'].value_counts(normalize=True) * 100
Keys = shapes.keys().to_list()
@davidbradway
davidbradway / .block
Last active February 9, 2018 19:37 — forked from mbostock/.block
Lab Notebook Meta-data. A look at prices charged at the Duke University Bookstore over 20 years.
license: gpl-3.0
@davidbradway
davidbradway / README.md
Created August 11, 2016 18:42 — forked from jasondavies/README.md
World Map

Based on Mike Bostock’s [World Map][0], modified to automatically colour countries such that no adjacent countries share the same colour.

This is done by extracting the topology via [TopoJSON][1] and greedily picking colours until the constraint is fulfilled.

See also: [Graph coloring][2] on Wikipedia.

Update: Greedily colouring is now performed in a single line, thanks to Mike Bostock!

@davidbradway
davidbradway / .block
Last active August 11, 2016 18:29 — forked from armollica/.block
HTML Annotation
height: 960