Skip to content

Instantly share code, notes, and snippets.

View indiejoseph's full-sized avatar
🏠
Working from home

Joseph Cheng indiejoseph

🏠
Working from home
View GitHub Profile
from math import sqrt
def ttest(x1, x2):
"Student's t-test for unpaired, equal variance, equal size samples."
if len(x1) != len(x2):
raise ValueError('unequal sample sizes')
mx1 = sum(x1) / len(x1)
mx2 = sum(x2) / len(x2)
s2x1 = sum((xi - mx1)**2 for xi in x1) / (len(x1) - 1)
s2x2 = sum((xi - mx2)**2 for xi in x2) / (len(x2) - 1)
@indiejoseph
indiejoseph / brew.txt
Created July 3, 2012 04:10 — forked from leesmith/brew.txt
Homebrew: install specific version of formula
cd /usr/local
brew versions postgresql
git checkout -b postgresql-8.4.4 [some hash]
brew install postgresql
git checkout master
git branch -d postgresql-8.4.4
http://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula