Skip to content

DEPR: remove freq attribute of Timestamp? #15146

Closed
@jreback

Description

@jreback

xref #15141 (comment)

In theory these should be completely fungible. If so, we should remove the freq attribute
of Timestamps and instead return Periods in those instances.

In [2]: t = Timestamp('2010-01-03 00:00:00', freq='W-SUN')

In [3]: t
Out[3]: Timestamp('2010-01-03 00:00:00', freq='W-SUN')

In [4]: t.to_period()
Out[4]: Period('2009-12-28/2010-01-03', 'W-SUN')

In [5]: t.to_period().to_timestamp(how='start')
Out[5]: Timestamp('2009-12-28 00:00:00')

In [6]: t.to_period().to_timestamp(how='end')
Out[6]: Timestamp('2010-01-03 00:00:00')

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatetimeDatetime data dtypeDeprecateFunctionality to remove in pandasFrequencyDateOffsets

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions