Gold Market Analysis

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


Populating the interactive namespace from numpy and matplotlib

In [2]:
df = pd.read_csv('gld.csv')

In [3]:
# Show column headings
df.columns


Out[3]:
Index([Date, Open, High, Low, Close, Volume, Adj Close], dtype=object)

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]:
<matplotlib.axes.AxesSubplot at 0x10692bc90>