0

I am trying to turn a series of ISO dates into equivalent timestamps:

from Orange.data import TimeVariable

unix_stamp = TimeVariable.parse('2020-12-31')

print(unix_stamp)

I get the error

TypeError: parse() missing 1 required positional argument: 'datestr'

What should I write?

For reference, the manual (https://docs.biolab.si//3/data-mining-library/reference/data.variable.html) reads:

class Orange.data.TimeVariable(*args, have_date=0, have_time=0, **kwargs)

TimeVariable is a continuous variable with Unix epoch (1970-01-01 00:00:00+0000) as the origin...

parse(datestr)

Return datestr, a datetime provided in one of ISO 8601 formats, parsed as a real number.

boisvert
  • 3,679
  • 2
  • 27
  • 53
  • 1
    You need to create an instance of `TimeVariable` first, to call its `parse` method. – mkrieger1 Apr 04 '20 at 18:00
  • Does this answer your question? [TypeError: attack() missing 1 required positional argument: 'self'](https://stackoverflow.com/questions/30174847/typeerror-attack-missing-1-required-positional-argument-self) – mkrieger1 Apr 04 '20 at 18:01
  • @mkrieger the problem is the same (unistantiated class) but I would never have found out from the other question, without enough prior knowledge of Python. But my question is answered. – boisvert Apr 04 '20 at 18:11

0 Answers0