Skip to content

API: Change Panel.shift arg signature to match generic's #6910

Closed
@TomAugspurger

Description

@TomAugspurger

This surfaced in the Panel pct_change implementation at #6909

generic: def shift(self, periods=1, freq=None, axis=0, **kwds):
Panel: def shift(self, lags, freq=None, axis='major'):

I had to adjust the call to shift in generic.pct_change to not use a kwarg for lag/period:

Before: rs = data / data.shift(periods=periods, freq=freq, **kwds) - 1
After: rs = data.div(data.shift(periods, freq=freq, **kwds)) - 1

We'll need to keep the .div change, but we can change back the kwarg once the signatures are aligned.

  • Add kwarg deprecation decorator
  • change pct_change back to kwarg

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignDeprecateFunctionality to remove in pandasReshapingConcat, Merge/Join, Stack/Unstack, Explode

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions