Serves: 2
- 1 Whole Fish (approx. 400g), gutted with head and tail still on.
- 5-6 Spring Onions
### Download and install | |
cd /tmp | |
curl http://erlang.org/download/otp_src_R13B03.tar.gz | tar zx | |
cd otp_src_R13B | |
./configure --enable-hipe | |
make | |
sudo make install | |
sudo mkdir -p /Library/Erlang/lib | |
mkdir -p ~/Library/Erlang/lib |
include Java | |
require 'blpapi3.jar' | |
opts = com.bloomberglp.blpapi.SessionOptions.new | |
opts.server_host = 'localhost' | |
opts.server_port = 8194 | |
session = com.bloomberglp.blpapi.Session.new opts | |
service = '//blp/refdata' | |
throw "Can't start Bloomberg" unless session.start && session.open_service(service) |
from bisect import bisect_left, bisect_right | |
class TimeseriesCache(object): | |
"""Store a timeseries of data in memory for random access.""" | |
def __init__(self, ttl=None): | |
self.timestamps = [] | |
self.data = [] | |
self.ttl = ttl | |
def add(self, timestamp, data): |
import numpy as np | |
import pylab as lab | |
# don't show all decimal places when printing | |
np.set_printoptions(precision=4) | |
# define a, b and c | |
a = np.ones([4,4]) | |
print "a:\n", a | |
import pandas as pd | |
p = pd.read_csv('m:/presents.csv') | |
p[:10] | |
plt.plot(p[:10]) | |
p.columns= 'id x y z'.split() | |
p['volume'] = p.x * p.y * p.z |