Skip to content

Instantly share code, notes, and snippets.

View TheDataLeek's full-sized avatar

Zoë TheDataLeek

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as ptch
import matplotlib.lines as lne
import matplotlib.animation as ani
{
"cells": [
{
"cell_type": "code",
"execution_count": 57,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
{
"cells": [
{
"cell_type": "code",
"execution_count": 39,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
@TheDataLeek
TheDataLeek / bogosort.py
Last active March 14, 2017 18:30
Parallel Bogosort
#!/usr/bin/env python3.6
import sys
import time
import random
import multiprocessing as mp
from multiprocessing import Queue
from tqdm import tqdm
import numpy as np
#!/usr/bin/env python3.6
import time
import math
import numpy as np
import random
def distance(coord1, coord2):
return math.sqrt(sum((coord1[i] - coord2[i])**2
for i in range(len(coord1))))
@TheDataLeek
TheDataLeek / politicalboundaries.py
Last active November 14, 2017 00:18
Code for Political Boundary Simulations
#!/usr/bin/env python3.6
"""
Simulated Annealing and Genetic Algorithm solutions to districting problem.
Notes on implementation:
* I like properties and I use them in a couple spots...
* Use `pip install --user -r requirements.txt` on the requirements file
available in the root of this git repository.
* If by some strange happenstance you only have this file, go to the
#!/usr/bin/env python3
import sys
import os
import argparse
import re
from pprint import pprint as pp
import pytz
import dateutil