This file contains hidden or 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
lizphair:~ paul$ brew install -v postgresql | |
==> Downloading http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.bz2 | |
File already downloaded in /Users/paul/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/paul/Library/Caches/Homebrew/postgresql-9.1.2.tar.bz2 | |
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.1.2 --enable-thread-safety --with-bonjour --with-gssapi --with-krb5 --with-openssl --with-libxml --with-libxslt --with-python --with-perl --with-ossp-uuid --datadir=/usr/local/Cellar/postgresql/9.1.2/share/postgresql --docdir=/usr/local/Cellar/postgresql/9.1.2/share/doc/postgresql ARCHFLAGS='-arch x86_64' | |
./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.1.2 --enable-thread-safety --with-bonjour --with-gssapi --with-krb5 --with-openssl --with-libxml --with-libxslt --with-python --with-perl --with-ossp-uuid --datadir=/usr/local/Cellar/postgresql/9.1.2/share/postgresql --docdir=/usr/local/Cellar/postgresql/9.1.2/share/doc/postgresql ARCHFLAGS='-arch x86_64' | |
c |
This file contains hidden or 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 __future__ import division | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.stats as stats | |
#import DataAccess as db | |
import pdb | |
def getTestData(): | |
''' | |
generates test data |
This file contains hidden or 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
# Props to Gökhan Sever for the idea | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.cm as cm | |
x = np.linspace(0, 3 * np.pi, 5000) | |
y = np.sin(x) | |
z = np.cos(0.5 * (x[:-1] + x[1:])) # 1st derivative | |
cmap_z = cm.coolwarm(z) |
This file contains hidden or 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
''' | |
This demonstrates the new boxplot functionality. | |
It trys to create 5 figures, each with 4 subplots. Only the first | |
fourth figures should work. The second and third figures are | |
supposed to fail as the number of user-input medians and | |
confidence intervals do not match the number of columns | |
in the data. | |
The first working figure plots all of the data with and without |
This file contains hidden or 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
lizphair:Downloads paul$ brew upgrade | |
==> Upgrading 6 outdated packages, with result: | |
postgis 2.0.0, sip 4.13.2, qt 4.8.2, pyqt 4.9.1, python 2.7.3, zeromq 2.2.0 | |
==> Upgrading postgis | |
==> Downloading http://postgis.org/download/postgis-2.0.0.tar.gz | |
curl: (6) Could not resolve host: postgis.org; nodename nor servname provided, or not known | |
Error: Download failed: http://postgis.org/download/postgis-2.0.0.tar.gz |
This file contains hidden or 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
import pyodbc | |
import numpy as np | |
import datetime | |
import pandas | |
def processCursor(cur, dataframe=False): | |
datatypes = [] | |
colinfo = cur.description | |
for col in colinfo: | |
if col[1] == unicode: |
This file contains hidden or 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
import numpy as np | |
import statsmodels.api as sm | |
import matplotlib.pyplot as plt | |
x = np.random.normal(4.0, 1.75, size=37) | |
fig, (ax1, ax2) = plt.subplots(nrows=2) | |
sm.qqplot(x, prob=False, ax=ax1) | |
sm.qqplot(x, prob=True, ax=ax2) |
This file contains hidden or 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
\documentclass{minimal} | |
\usepackage{siunitx} | |
\usepackage[sc]{mathpazo} | |
\linespread{1.05} % Palatino needs more leading (space between lines) | |
\usepackage[T1]{fontenc} | |
\begin{document} | |
who wins? | |
\si{\micro\gram\per\liter} vs. $\mu$g/L | |
\end{document} |
This file contains hidden or 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
import numpy as np | |
def acceleration(data): | |
SSD = np.sum((data.mean() - data)**3) | |
SCD = np.sum((data.mean() - data)**2) | |
# catch to make sure SCD isn't zero | |
if SCD == 0.0: | |
SCD = 1e-12 | |
acc = SSD / (6 * SCD**1.5) | |
return acc |
This file contains hidden or 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
import matplotlib.pyplot as plt | |
import scipy.stats as stats | |
import statsmodels.api as sm | |
# longley dataset | |
data = sm.datasets.longley.load() | |
data.exog = sm.add_constant(data.exog) | |
model = sm.OLS(data.endog, data.exog) | |
mod_fit = model.fit() | |
res = mod_fit.resid |
OlderNewer