Skip to content

Instantly share code, notes, and snippets.

#make sure llvm-3.3 is installed! + numba requirements
sudo apt-get install llvm cython python-pip llvm-3.3
sudo LLVM_CONFIG_PATH=/usr/lib/llvm-3.3/bin/llvm-config pip install llvmpy
sudo pip install numba
#!/bin/sh
mkdir ~/down/
cd ~/down/
sudo apt-get install build-essential
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar -xzf Python-2.7.2.tgz
cd Python-2.7.2
sudo apt-get install libsqlite3-dev zlib1g-dev libncurses5-dev
sudo apt-get install libgdbm-dev libbz2-dev libreadline5-dev
sudo apt-get install libssl-dev libdb-dev
@schalekamp
schalekamp / yahoo
Last active August 29, 2015 14:08 — forked from szs8/yahoo
#!/usr/bin/env python
import dateutil
from datetime import date, datetime
import numpy as np
import pandas as pd
import requests
class YahooException(Exception):
@schalekamp
schalekamp / RiskAdjustedReturnMetrics.py
Created October 5, 2015 06:58 — forked from StuartGordonReid/RiskAdjustedReturnMetrics.py
Measured of Risk-adjusted Return
import math
import numpy
import numpy.random as nrand
"""
Note - for some of the metrics the absolute value is returns. This is because if the risk (loss) is higher we want to
discount the expected excess return from the portfolio by a higher amount. Therefore risk should be positive.
"""