Skip to content

to_datetime loses freq on DatetimeIndex with offset #6562

Closed
@cancan101

Description

@cancan101

It would be cool if the offset were kept. Perhaps even an error should be raised if not all of the Timestamps have the same offset:

In [36]:
dti = pd.to_datetime([pd.Timestamp("2014-1-1", offset="M"),])
dti

Out[36]:
<class 'pandas.tseries.index.DatetimeIndex'>
[2014-01-01]
Length: 1, Freq: None, Timezone: None

See #6560

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions