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
| # if you can, just use wget | |
| # wget -np -r remote_url | |
| import re | |
| import os | |
| import urllib2 | |
| import urlparse | |
| import pycurl | |
| from lxml import html |
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
| c = get_config() | |
| # lines of code to run at IPython startup. | |
| c.TerminalIPythonApp.exec_lines = [ | |
| 'Exit = exit', | |
| 'import numpy as np', | |
| 'np.set_printoptions(suppress=True)', | |
| 'import statsmodels.api as sm', | |
| 'import matplotlib.pyplot as plt', | |
| 'from scipy import stats, optimize', |
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
| function rmpy { | |
| if [ -z "$1" ]; then | |
| echo "Aren't you glad I didn't delete everything?"; | |
| else | |
| sudo rm -rf /usr/local/lib/python2.7/dist-packages/$1* | |
| fi | |
| } |
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
| ########################################### | |
| # Note: this requires PR # 245 in numpy | |
| # https://github.com/numpy/numpy/pull/245 | |
| # | |
| # Author: Skipper Seabold | |
| # License: BSD | |
| import numpy as np | |
| def cut(x, bins, right=True): |
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 pandas import DataFrame | |
| import numpy as np | |
| from scipy import stats | |
| def anova_lm(*args, **kwargs): | |
| """ | |
| ANOVA table for one or more fitted linear models. | |
| Parmeters | |
| --------- |
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
| #! /bin/bash | |
| # edit this to install whatever you want that depends on numpy after you | |
| # reinstall numpy | |
| # edit these variables or add to them | |
| npsrc="$HOME/src/numpy/" | |
| spsrc="$HOME/src/scipy/" | |
| pdsrc="$HOME/src/pandas/" | |
| smsrc="$HOME/statsmodels/statsmodels/" |
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 statsmodels.model import LikelihoodModel | |
| import numpy as np | |
| from numpy import asarray | |
| from scipy import optimize | |
| def log_star(z, eps): | |
| """ | |
| Owens' log* function. Provides curvature at eps. | |
| """ | |
| log_idx = z > eps |
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
| /* | |
| Put a variable or variable list into a Stata matrix even if it's bigger than | |
| matsize. | |
| Usage: | |
| If you have some variables xb1 and xb2 | |
| bigmat xb1 xb2, mat(new_mat) |
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
| """ | |
| Use a decorator to transform the params input to a likelihood function. | |
| """ | |
| from functools import wraps | |
| from contextlib import contextmanager | |
| import numpy as np | |
| import inspect | |
| def make_doc(func, wrapper): | |
| argspec = inspect.getargspec(func) |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| You need to fill in your API key from google below. Note that querying | |
| supported languages is not implemented. | |
| Language Code | |
| -------- ---- | |
| Afrikaans af | |
| Albanian sq | |
| Arabic ar |