-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Closed
Closed
Copy link
Labels
DatetimeDatetime data dtypeDatetime data dtypeEnhancementNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action
Description
Problem description
When creating a DatetimeIndex
partially-bounded, i.e., only specifying either start
or end
the use of a closed
parameter different from None
was intended to be disallowed. This behaviour is bugged as shown in #23198. #23199 solves this bug.
Before #23199, the DatetimeIndex was successfully created. The result contained one less than the requested periods
in some cases as shown in #23176.
After #23199, a ValueError
will be raised as it seemed to be intended.
The proposal is to allow closed
parameters different to None
for partially-bounded DatetimeIndex
es. The behaviour should be as defined in the following table
Periods | Ommited parameter | Closed | Current number of items | After #23199 | Proposed number of items |
---|---|---|---|---|---|
N | end |
None |
N | N | N |
N | end |
"left" |
N-1 | ValueError |
N |
N | end |
"right" |
N | ValueError |
N |
N | start |
None |
N | N | N |
N | start |
"left" |
N | ValueError |
N |
N | start |
"right" |
N-1 | ValueError |
N |
Metadata
Metadata
Assignees
Labels
DatetimeDatetime data dtypeDatetime data dtypeEnhancementNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action