Skip to content

implement non-controversial cleanup portions of #18762 #18959

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

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
revert day_opt--day
  • Loading branch information
jbrockmendel committed Dec 27, 2017
commit a724963f71058157de580c291bd23e9a8ad181b2
4 changes: 2 additions & 2 deletions pandas/_libs/tslibs/offsets.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -583,12 +583,12 @@ def shift_quarters(int64_t[:] dtindex, int quarters,

@cython.wraparound(False)
@cython.boundscheck(False)
def shift_months(int64_t[:] dtindex, int months, object day_opt):
def shift_months(int64_t[:] dtindex, int months, object day):
"""
Given an int64-based datetime index, shift all elements
specified number of months using DateOffset semantics

day_opt: {None, 'start', 'end', 'business_start', 'business_end'}
day: {None, 'start', 'end', 'business_start', 'business_end'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the None as a valid argument or is it? also need to fix the code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None is valid.

* None: day of month
* 'start' 1st day of month
* 'end' last day of month
Expand Down
2 changes: 1 addition & 1 deletion pandas/tseries/offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def apply_index(self, i):
months = ((self.kwds.get('years', 0) * 12 +
self.kwds.get('months', 0)) * self.n)
if months:
shifted = liboffsets.shift_months(i.asi8, months, day_opt=None)
shifted = liboffsets.shift_months(i.asi8, months, day=None)
i = i._shallow_copy(shifted)

weeks = (self.kwds.get('weeks', 0)) * self.n
Expand Down