This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |