Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 19th, 2012  |  syntax: None  |  size: 0.45 KB  |  views: 44  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. 1 from pandas.io.data import DataReader                                                                                        
  2.   2 from datetime import datetime
  3.   3  
  4.   4 dr = DataReader("YHOO", "yahoo")
  5.   5  
  6.   6 print "Yahoo's stock price over time"
  7.   7 print dr["Volume"]
  8.   8  
  9.   9 yh_by_date = DataReader("YHOO",  "yahoo", datetime(2009,1,1))
  10.  10  
  11.  11 print "We want to restrict it based on specific dates"
  12.  12 print yh_by_date["Adj Close"][-100:]