Created
August 15, 2014 00:03
-
-
Save eldritchideen/556bf5ea2091d59923ff to your computer and use it in GitHub Desktop.
Some Pandas Share price stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pandas import * | |
import pandas.io.data as web | |
import datetime | |
start = datetime.datetime(2010, 1, 1) | |
end = datetime.datetime(2014, 8, 15) | |
# Get daily price data | |
ctx = web.DataReader('ctx.ax', 'yahoo', start, end) | |
wkly = ctx['Adj Close'].resample('W-FRI', how='ohlc') | |
wkly_vol = ctx['Volume'].resample('W-FRI', how='mean') | |
df = DataFrame(wkly) | |
df['Avg Vol'] = wkly_vol | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment