Skip to content

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

Description

@AwesomeCap

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions