Skip to content

ENH:Resume the 'loffset' arguments in Grouper and resample #40367

Closed
@leohazy

Description

@leohazy

i noticed that the 'loffset' arguments in Grouper and resample is deprecated since v1.1.0 #31809.The new arguments 'origin' and 'offset' are use to specify the start of bin.The 'loffset' is use for ajusting the result labels, which is a useful Feature.without the 'loffset',we need to add the offset to the index after group/resample,it's a little boring。

from pandas.tseries.frequencies import to_offset
loffset = '19min'
ts_out = ts.resample('17min').sum()
ts_out.index = ts_out.index + to_offset(loffset)

To avoid the confusion,you can change 'loffset' to 'label_offset' .

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNeeds DiscussionRequires discussion from core team before further actionResampleresample method

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions