yahoo-historical
yahoo-historical copied to clipboard
TypeError: type object argument after * must be an iterable, not float
I tested the code in Python3.7:
from yahoo_historical import Fetcher
import datetime
import time
# create unix timestamp representing January 1st, 2007
timestamp = time.mktime(datetime.datetime(2007, 1, 1).timetuple())
data = Fetcher("AAPL", timestamp)
print(data.get_historical())
And I got:
TypeError Traceback (most recent call last)
/var/folders/5z/nfxgl_ps6qlf5tvrct964q980000gn/T/ipykernel_77052/2760101674.py in
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/yahoo_historical/fetch.py in init(self, ticker, start, end, interval) 20 self.ticker = ticker.upper() 21 self.interval = interval ---> 22 self.start = int(cal.timegm(dt.datetime(*start).timetuple())) 23 24 if end is not None:
TypeError: type object argument after * must be an iterable, not float