- autcomplete works on variable and function names
- Up arrow takes you back to previously entered commands
%quickref
gives an overview of available functionality.
iPython has "magic" commands which are an set of meta functions for
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 |
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 | |
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): |
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) |
### 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 |
#!/usr/bin/env ruby | |
# Originally by Mike Clark. | |
# | |
# From http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/StakingOutFileChanges.rdoc | |
# | |
# Runs a user-defined command when files are modified. | |
# | |
# Can use Ruby's Dir[] to get file glob. Quote your args to take advantage of this. | |
# |
# Built in library imports | |
import mimetypes | |
import re | |
import os | |
import sys | |
# Server imports | |
import urlparse | |
import cgi | |
class Juno(object): |