Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

playing with ipython notebook and yahoo stock data

View long_term_growth_10k.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
# -*- 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
Something went wrong with that request. Please try again.