-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Interval.__contains__(self, other: Interval) #46613
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
Comments
@jreback thanks for your reply. I know about what you just referred to. It works with |
@tgy is this similar to interval overlap? Maybe |
Thanks for your reply. I know about the Interval containment is different from interval overlap. First of all, the This simple observation is already enough to understand that these two operators are different. But let's take a concrete example as well. The two intervals |
You can find this functionality in |
ah thanks @venaturum! that package fell under my radar. interesting. |
take |
* ENH: Support For Interval __contains__ Other Interval (#46613) * ENH: Support For Interval __contains__ Other Interval (#46613) * Update doc/source/whatsnew/v1.5.0.rst Co-authored-by: Valentin Iovene <[email protected]> * ENH: Support For Interval __contains__ Other Interval (#46613) * ENH: Support For Interval __contains__ Other Interval (#46613) * Fix: Unintentionally Modified Range * ENH: Support For Interval __contains__ Other Interval (#46613) * Fix: Unintentionally Modified Range * ENH: Support For Interval __contains__ Other Interval (#46613) Co-authored-by: Valentin Iovene <[email protected]>
…) (pandas-dev#47927) * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * Update doc/source/whatsnew/v1.5.0.rst Co-authored-by: Valentin Iovene <[email protected]> * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * Fix: Unintentionally Modified Range * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * Fix: Unintentionally Modified Range * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) Co-authored-by: Valentin Iovene <[email protected]>
…) (pandas-dev#47927) * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * Update doc/source/whatsnew/v1.5.0.rst Co-authored-by: Valentin Iovene <[email protected]> * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * Fix: Unintentionally Modified Range * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * Fix: Unintentionally Modified Range * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) Co-authored-by: Valentin Iovene <[email protected]>
Is your feature request related to a problem?
Not a problem. Just a feature I would have liked to have! :-)
I would like to be able to know if an
Interval
is contained into anotherInterval
.e.g.
[2, 3)
is contained in[2, 4)
but not in(2, 4]
Describe the solution you'd like
Something like this
API breaking implications
Currently, if you do something like this
it raises the following exception
Adding support for another type of object in
__contains__
would not break the API, but just extend it.Describe alternatives you've considered
Could not find any.
The text was updated successfully, but these errors were encountered: