Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am djordon on github.
  • I am djordon (https://keybase.io/djordon) on keybase.
  • I have a public key ASBt4uQm6TK5WkueZkEnZpLVJnFAkPdGZkLloNWHGH4_IQo

To claim this, I am signing this object:

@djordon
djordon / checkout_analysis.py
Last active June 11, 2016 16:54
An analysis of different grocery store checkout processes.
import matplotlib.pyplot as plt
import queueing_tool as qt
import numpy as np
# Queueing parameters
a, b = 158, 50
h = 13.0
nc = 8
mu = 30.0
@djordon
djordon / get_destinations.py
Last active August 29, 2015 14:15
Retrieves the destination and garage location information of downtown Pittsburgh from parkpgh.org.
import requests
import json
import re
def get_dests():
page = requests('http://parkpgh.org')
page = page.text
expr1 = re.compile('park.lots = \[\{[^\;]+')
expr2 = re.compile('park.destinations = \[\{[^\;]+')
@djordon
djordon / create_income_figures.py
Last active June 29, 2020 16:27
A script that creates a comma separated file of income data from a text file
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import os
races = ['all', 'black', 'white', 'white_non_hispanic', 'hispanic', 'asian']
race = races[0]
racec = race.replace('_', ' ').capitalize()
if not os.path.exists('./bar_plots_' + race) :
@djordon
djordon / union-find.py
Last active August 29, 2015 14:04
The union-find data structure with union-by-rank and path compression
class UnionFind(object) :
"""The union-find data structure with union by rank and path compression.
The UnionFind data structure is a collection of objects that supports
the union and find operations (described below). Each object in the
collection belongs to a set, which is identified by its leader. Using the
``union(s1, s2)`` operation, the two sets that contain ``s1`` and ``s2``
can be fused together to form a new set. The ``find(s)`` operation
identifies the leader of the set to which ``s`` belongs.
@djordon
djordon / downtown_pitt.ipynb
Last active August 29, 2015 14:03
iPython notebook for creating the network of downtown Pittsburgh
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.