classmethod IntervalIndex.from_arrays(left, right, closed='right', name=None, copy=False, dtype=None)
[source]
Construct from two arrays defining the left and right bounds.
Parameters: |
|
---|---|
Returns: |
|
Raises: |
|
See also
interval_range
IntervalIndex.from_breaks
IntervalIndex.from_tuples
Each element of left
must be less than or equal to the right
element at the same position. If an element is missing, it must be missing in both left
and right
. A TypeError is raised when using an unsupported type for left
or right
. At the moment, ‘category’, ‘object’, and ‘string’ subtypes are not supported.
>>> IntervalIndex.from_arrays([0, 1, 2], [1, 2, 3]) IntervalIndex([(0, 1], (1, 2], (2, 3]], closed='right', dtype='interval[int64]')
© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.IntervalIndex.from_arrays.html