yahoo-historical icon indicating copy to clipboard operation
yahoo-historical copied to clipboard

TypeError: type object argument after * must be an iterable, not float

Open AwesomeCap opened this issue 1 year ago • 3 comments

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 6 timestamp = time.mktime(datetime.datetime(2007, 1, 1).timetuple()) 7 ----> 8 data = Fetcher("AAPL", timestamp) 9 print(data.get_historical())

/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

AwesomeCap avatar Feb 10 '23 11:02 AwesomeCap