Create a gist now

Instantly share code, notes, and snippets.

anonymous /long_term_growth_10k.py
Created Jan 3, 2013

playing with ipython notebook and yahoo stock data
# -*- coding: utf-8 -*-
# <nbformat>2</nbformat>
# <codecell>
import datetime as dt
import pandas as pd
# <codecell>
symbol = 'vcadx'
starting_value = 10000
# <codecell>
symbol_pd = pd.read_csv('yahoo-data/' + symbol + '.csv', names=None, index_col='Date', parse_dates=True)
symbol_pd = symbol_pd.sort_index()
# <codecell>
adj_close = symbol_pd['Adj Close']
first_price = adj_close.ix[0]
shares = starting_value / first_price
# <codecell>
adj_close = adj_close * shares
# <codecell>
adj_close.plot()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment