Author: Kat Chuang @katychuang on Twitter
Data from Yahoo Finance, saved as gld.csv
In [1]:
#keeps figures in notebook
%pylab inline
#import packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
In [2]:
df = pd.read_csv('gld.csv')
In [3]:
# Show column headings
df.columns
Out[3]:
In [4]:
# Plot the following as timeseries
ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2004', periods=1000))
ts = ts.cumsum()
ts.plot()
Out[4]: