Skip to content

PERF: infer_datetime_format fails without zero-padding #11142

Closed
@chris-b1

Description

@chris-b1

I think this can be fixed by just padding tokens in the inference step. The dates do parse, just always fall back to the slow path, even with infer_datetime_format=True

In [22]: from pandas.tseries.tools import _guess_datetime_format

In [23]: _guess_datetime_format('02/02/2014')
Out[23]: '%m/%d/%Y'

In [24]: _guess_datetime_format('2/2/2014')

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatetimeDatetime data dtypePerformanceMemory or execution speed performance

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions