Without using matplotlib finance module. I like to get the url data into a numpy array.
where I can to column heading to do math. Like:
prices = r.adj_close
From:
http://matplotlib.sourceforge.net/examples/pylab_examples/finance_work2.html
except I dont want to use the:
fh = finance.fetch_historical_yahoo(ticker, startdate, enddate)
# a numpy record array with fields: date, open, high, low, close, volume, adj_close)
r = mlab.csv2rec(fh); fh.close()
r.sort()
Using manually create the url:
url = http://ichart.yahoo.com/table.csv?a=2&c=2011&b=30&e=7&d=7&g=d&f=2011&s=msft&ignore=.csv
f = urllib.urlopen(url)
fr = f.read()
hdata = np.asarray(fr, dtype='object')
prices = hdata.adj_close
print prices
use numpy.loadtxt() to load csv:
the first column is date, so use pylab.datestr2num to convert it to number.