Skip to content

Instantly share code, notes, and snippets.

View abehmiel's full-sized avatar

Abraham Hmiel abehmiel

View GitHub Profile
@abehmiel
abehmiel / nycc-tech-committee-algotransparency.org
Last active April 12, 2018 19:11
My notes of the NYCC Tech Committee meeting on the Algorithmic Transparency Bill, 16-96

These notes may have errors and omissions. I couldn’t get the names of a lot of the speakers and there are some places where I was thinking or distracted. I make no claims as to the completeness of this information

Algorithmic transparency legislation hearing 10/16/17

James Vaca, Chair of NYCC committee on technology

16-96 2017 Measures of transparency when NYC uses algorithms to impose penalties, police persons

  • Requires publication of source code and querying systems with sample data

  • If left unchecked, algorithms can have negative repercussions
  • Algorithms are a way of encoding assumptions
@abehmiel
abehmiel / gist:d932a2b3028f836194db7cb3ffd49334
Created October 17, 2017 20:30 — forked from econchick/gist:4666413
Python implementation of Dijkstra's Algorithm
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
def add_edge(self, from_node, to_node, distance):
@abehmiel
abehmiel / botmakers-10-11.org
Last active October 18, 2017 20:32
Notes on Botmakers meetup

Taken at Babycastles in NYC 10/11 NYC Botmakers Meetup for more info: https://www.meetup.com/botmakers/ I make no claims as to the completeness of these notes

Conversational chatbots - Gautam

3 days of full development (idk what a bot is to v0.1)

chatbot client -> chatbot server -> conversation API

What is the weather in nyc? turn that into intent which the server can understand

@abehmiel
abehmiel / fuzzy_join.py
Created October 31, 2017 19:10
Pandas fuzzy join
import difflib
# input data
df1 = DataFrame([[1],[2],[3],[4],[5]], index=['one','two','three','four','five'], columns=['number'])
df2 = DataFrame([['a'],['b'],['c'],['d'],['e']], index=['one','too','three','fours','five'], columns=['letter'])
# want to obtain:
# number letter
# one 1 a
# two 2 b
@abehmiel
abehmiel / figure_formatting.py
Created October 31, 2017 21:29 — forked from corbett/figure_formatting.py
Create beautiful square figures with big labels and the correct number of ticks
def create_figure(size=3.6,nxticks=6):
import matplotlib
from matplotlib.ticker import MaxNLocator
figure=matplotlib.pyplot.figure(figsize=(size,size))
ax = figure.add_subplot(1, 1, 1, position = [0.2, 0.15, 0.75, 0.75])
ax.xaxis.set_major_locator(MaxNLocator(nxticks))
return ax
def format_axes(ax,xf='%d',yf='%d',nxticks=6,nyticks=6,labelsize=10):
import pylab
@abehmiel
abehmiel / fix_exhibit_b.py
Created November 1, 2017 21:12
Convert tabular pdf data to a csv and also read it as a python dataframe
# It's really stupid when the gov't releases pdf's of tabular data. So I made a quick, hacky script to
# fix their mistakes for them. (I'm referring to https://t.co/oOyhHNVvjS )
# requirements:
# pandas
# tabula-py
import pandas as pd
from tabula import read_pdf
@abehmiel
abehmiel / spacy_intro.ipynb
Created November 16, 2017 23:03 — forked from aparrish/spacy_intro.ipynb
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abehmiel
abehmiel / understanding-word-vectors.ipynb
Created November 19, 2017 03:07 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abehmiel
abehmiel / regex.md
Created December 11, 2017 21:36 — forked from magicznyleszek/regex.md
RegEx Cheatsheet
@abehmiel
abehmiel / gist:e5dd495ca6123fda20ee876d58a6cd8f
Created December 15, 2017 23:18 — forked from rohannog/gist:3861442
Decrypt pdf on command-line
qpdf --password=passwd --decrypt orig.pdf decrypted.pdf
#To input the password
read -s -p "Password: " password && qpdf --password=$password --decrypt orig.pdf decrypted.pdf