Okay so i am trying to get a price range for a stock.
import datetime as dt
from datetime import date
from datetime import time
start = datetime.datetime(2010,1,1)
end = datetime.datetime(2016,12,28)
SPWR = pdr.get_data_yahoo('SPWR' start, end)
I am running Python 3.6
You have imported
datetime as dt
, but you're trying to refer todatetime
in your code. Swap outdatetime
fordt
and you should be good syntactically.Note, however, that Yahoo recently changed its API endpoints. That means
get_data_yahoo()
now returns an error. This is a a known issue, currently unresolved.