Skip to content

Garbled dates in pandas 0.18.0 #12808

Closed
Closed
@aisthesis

Description

@aisthesis

Using pandas 0.18.0 and pandas-datareader 0.2.1:

>>> from pandas_datareader.data import Options
>>> tsla = Options('tsla', 'yahoo')
>>> data = tsla.get_all_data()
>>> data.index.levels[1]
DatetimeIndex(['2008-04-16', '2015-04-16', '2016-09-16', '2017-06-16',
       '2019-01-18', '2020-01-17', '2020-05-16', '2022-04-16',
       '2029-04-16'],
      dtype='datetime64[ns]', name='Expiry', freq=None)

The above expiries are non-sensical and are the result of confusing the day of the month with the year. Using pandas 0.17.1 and pandas-datareader 0.2.1, I correctly get:

>>> from pandas_datareader.data import Options
>>> tsla = Options('tsla', 'yahoo')
>>> data = tsla.get_all_data()
>>> data.index.levels[1]
DatetimeIndex(['2016-04-08', '2016-04-15', '2016-04-22', '2016-04-29',
           '2016-05-06', '2016-05-13', '2016-05-20', '2016-06-17',
           '2016-09-16', '2017-01-20', '2018-01-19'],
          dtype='datetime64[ns]', name='Expiry', freq=None)

The relevant code seems to be run by pandas.io.parsers.TextParser, but I haven't tracked it further.

Cf. pydata/pandas-datareader#193 and GriffinAustin/pynance#28

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions