Skip to content

Instantly share code, notes, and snippets.

Matthew Wigginton Conway mattwigway

Block or report user

Report or block mattwigway

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View data
# Load the file referenced in the first argument into a Jupyter QtConsole as df
# change to appropriate conda environment
source activate py37
tee "$tempscript" <<EOF
import pandas as pd
View OSMnx Test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Explore Incorrect Number of HH Members on Trips.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# similar to Python's built in zip function, but yielding named tuples instead of tuples.
# i.e. list(namedzip(a=[1, 2], b=[3, 4])) => [namedzipitem(a=1, b=3), namedzipitem(a=2, b=4)]
# Author: Matthew Wigginton Conway <>
# feel free to use and share
from collections import namedtuple
def namedzip (**kwargs):
keys = list(kwargs.keys())
typ = namedtuple('namedzipitem', keys)
length = len(kwargs[keys[0]])
mattwigway /
Last active Jan 4, 2018
Matplotlib boxplot with custom summary stats
# To the extent possible under law, Matthew Wigginton Conway has waived all copyright and
# related or neighboring rights to this work. This work is published from: United States.
def customBoxPlot (whiskerLo, boxLo, med, boxHi, whiskerHi, **kwargs):
fakeData = [np.array([42, 42]) for i in whiskerLo]
bp = plt.boxplot(fakeData, **kwargs)
for i in range(len(whiskerLo)):
# This can't possibly be the best way to do this...
# lower whisker
mattwigway /
Last active Aug 21, 2017
Command-line tool to OCR PDFs
# OCR a PDF using Tesseract and Ghostscript
# (brew install tesseract, brew install ghostscript using Homebrew on a Mac)
# Usage: ocrpdf input.pdf output.pdf
# Copyright (c) 2017 Matthew Wigginton Conway
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
import org.mapdb.*;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
* Created by matthewc on 9/15/15.
mattwigway /
Created Sep 9, 2015
Replace bottom-coded values with null
# Remove all the -99999... values in the NL neighborhoods file and replace them with NULL
from sys import argv
import fiona
with[1]) as infile:
meta = infile.meta
meta['schema']['geometry'] = 'MultiPolygon'
View index.html
<!DOCTYPE html>
<title>MetricsGraphics Confidence Bound Test</title>
<link rel="stylesheet" href="" />
<div id="chart"></div>
<script src="" charset="utf-8"></script>
You can’t perform that action at this time.