BUG: default for pd.Interval of closed/inclusive changed on main from right to both
See original GitHub issuePandas version checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
print(pd.__version__)
i = pd.Interval(pd.Timestamp("2020-01-01"), pd.Timestamp("2020-01-02"))
print(repr(i))
print(i)
1.4.2
Interval('2020-01-01', '2020-01-02', closed='right')
(2020-01-01, 2020-01-02]
1.5.0.dev0+958.gf7be58a477
Interval('2020-01-01', '2020-01-02', inclusive='both')
[2020-01-01, 2020-01-02]
Issue Description
This isn’t mentioned in the release notes. We should decide on how to proceed.
Expected Behavior
Installed Versions
Replace this line with the output of pd.show_versions()
Issue Analytics
- State:
- Created a year ago
- Comments:19 (19 by maintainers)
Top Results From Across the Web
pandas.Interval — pandas 1.5.2 documentation
Immutable object implementing an Interval, a bounded slice-like interval. Parameters. leftorderable scalar. Left bound for the interval. rightorderable scalar.
Read more >How to change right-bounded interval into left ... - Stack Overflow
I use Interval from pandas. My main interval: main_interval = pd.Interval(left=0, right=1, closed='left ...
Read more >Package 'RMark' - Microsoft R Application Network
By default, the bins are open on the left and closed on the right (i.e., ... can be modified by changing the argument...
Read more >Python for Data Analysis - Free
Run the installer and accept the default installation location ... and EuroPython are the two main general Python conferences in the United States...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Should we maybe reconsider the actual deprecation of
closed
to start with (instead of fixing some issues caused by the deprecation)?I understand the strive for consistency in keyword arguments (and that certainly makes sense for things like
highlight_between
,between
andbetween_time
that those are consistent with each other), but specifically for the Interval-related methods, we already were consistently using the “closed” terminology. In addition:set_closed
should then also be deprecated/renamed?)highlight_between
,between
andbetween_time
) are not related to the Interval data type, so I think consistency between those methods and interval-related methods is less important as consistency within both groups.This has been reverted in https://github.com/pandas-dev/pandas/pull/48116, and the discussion to change
closed
toinclusive
can be discussed in https://github.com/pandas-dev/pandas/issues/40245 so closing in favor of that issue