You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was brought up by @shoyer in a different issue, and it makes sense to me
Adding closed to IntervalDtype makes sense to me, as in my mind closed is inherently part of the dtype. Since differing closed makes two IntervalIndex incompatible, I'd expect their dtypes to not be equal, but they currently are, which seems a little strange:
In [2]: ii1=pd.interval_range(0, 3, closed='left')
In [3]: ii2=pd.interval_range(0, 3, closed='right')
In [4]: ii1.dtype==ii2.dtypeOut[4]: True
There's also a larger discussion as to if adding closed to IntervalDtype would allow us to remove closed as a parameter to the IntervalIndex constructor. My preference would be to keep the closed parameter for user convenience, similar to how CategoricalIndex accepts categories and ordered parameters despite also accepting CategoricalDtype (though maybe this is just for legacy reasons). Willing to be convinced otherwise though.
This was brought up by @shoyer in a different issue, and it makes sense to me
Adding
closed
toIntervalDtype
makes sense to me, as in my mindclosed
is inherently part of the dtype. Since differingclosed
makes twoIntervalIndex
incompatible, I'd expect their dtypes to not be equal, but they currently are, which seems a little strange:There's also a larger discussion as to if adding
closed
toIntervalDtype
would allow us to removeclosed
as a parameter to theIntervalIndex
constructor. My preference would be to keep theclosed
parameter for user convenience, similar to howCategoricalIndex
acceptscategories
andordered
parameters despite also acceptingCategoricalDtype
(though maybe this is just for legacy reasons). Willing to be convinced otherwise though.xref #19263 (comment) (original comment)
xref #19370 (might be rendered moot)
cc @shoyer
The text was updated successfully, but these errors were encountered: