Skip to content

Instantly share code, notes, and snippets.

Created January 3, 2013 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4444836 to your computer and use it in GitHub Desktop.
Save anonymous/4444836 to your computer and use it in GitHub Desktop.
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