Skip to content

Instantly share code, notes, and snippets.

View ajschumacher's full-sized avatar

Aaron Schumacher ajschumacher

View GitHub Profile
import random
import math
def mean(elements):
return sum(elements) / len(elements)
def euclidean_dist(first, second):
assert len(first) == len(second)
return sum((f - s)**2 for f, s in zip(first, second))**0.5
@ajschumacher
ajschumacher / code.py
Last active May 26, 2021 19:36
Python 3.7.4 exception hierarchy
# inspired by and based on:
# https://julien.danjou.info/python-exceptions-guide/
# https://github.com/jd/julien.danjou.info/blob/master/bin/generate-python-exceptions-graph.py
import builtins
edges = set()
synonyms = {}
for name in dir(builtins):
item = getattr(builtins, name)

SQL workshop!


Get everything you can about people.

select * from people

-- comments

@ajschumacher
ajschumacher / snippets.md
Created July 18, 2023 18:40
public snippets

chi-squared test

import scipy.stats

obs = np.array([[a, b],
                [c, d]])
_, p, _, _ = scipy.stats.chi2_contingency(obs)