A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/docs/reference/api/pandas.arrays.IntervalArray.contains.html below:

pandas.arrays.IntervalArray.contains — pandas 2.3.1 documentation

pandas.arrays.IntervalArray.contains#
IntervalArray.contains(other)[source]#

Check elementwise if the Intervals contain the value.

Return a boolean mask whether the value is contained in the Intervals of the IntervalArray.

Parameters:
otherscalar

The value to check whether it is contained in the Intervals.

Returns:
boolean array

See also

Interval.contains

Check whether Interval object contains value.

IntervalArray.overlaps

Check if an Interval overlaps the values in the IntervalArray.

Examples

>>> intervals = pd.arrays.IntervalArray.from_tuples([(0, 1), (1, 3), (2, 4)])
>>> intervals
<IntervalArray>
[(0, 1], (1, 3], (2, 4]]
Length: 3, dtype: interval[int64, right]
>>> intervals.contains(0.5)
array([ True, False, False])

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4