BUG: Fix busday_count for reversed dates#23229
Conversation
|
Just to copy it here, we discussed the issue in the triage meeting and think we should just do it, as it seems clearly broken right now. This definitely needs the release note, though. I am also wondering if the test covers which day is excluded (start or end) in the path where only one of them is a business day? |
|
Hmmm, somehow I had misremembered it as just including the enddate, but it actually does exclude the startdate for negative values (i.e. it always excludes the larger date). I am OK with giving it a shot, but it does make me a bit less confident that nobody might be working around this in weird ways. I guess we merge it ping the mailing list? |
Sounds good. You want me to send an email to the mailing list? |
|
Happy if you do :). |
|
@Kai-Striega The suggestion has been made to move busday functionality to |
The function calculates the delta for a half open bracket. Question is: what is that bracket when you have enddates < begindates. For indexing, we always exclude the last: Current behavior: Sunday to Monday, with Monday excluded. Makes sense. But: Monday through Sunday, would have expected -1. The current behavior (a) does not match the docstring and (b) is hard to predict, so would support fixing it: always exclude the enddates. |
A few thoughts:
|
|
A message was sent to numpy-discussion for comments: https://mail.python.org/archives/list/numpy-discussion@python.org/thread/MGTAMT5ELASBMVMCWU2IOPR5CQLD7CUP/ |
|
Let's give this a shot then, thanks. |
Fixes #23197
This is a backwards incompatible change, so we need to add a release note.