Skip to content

Fixed PeriodArray._time_shift positional argument #24524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 31, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/core/arrays/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def fillna(self, value=None, method=None, limit=None):

# --------------------------------------------------------------------

def _time_shift(self, n, freq=None):
def _time_shift(self, periods, freq=None):
"""
Shift each value by `periods`.

Expand All @@ -437,7 +437,7 @@ def _time_shift(self, n, freq=None):
raise TypeError("`freq` argument is not supported for "
"{cls}._time_shift"
.format(cls=type(self).__name__))
values = self.asi8 + n * self.freq.n
values = self.asi8 + periods * self.freq.n
if self._hasnans:
values[self._isnan] = iNaT
return type(self)(values, freq=self.freq)
Expand Down