classmethod IntervalArray.from_arrays(left, right, closed='right', copy=False, dtype=None)
[source]
Construct from two arrays defining the left and right bounds.
Parameters: |
|
---|---|
Returns: |
|
Raises: |
|
See also
interval_range
IntervalArray.from_breaks
IntervalArray.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.
>>> IntervalArray.from_arrays([0, 1, 2], [1, 2, 3]) IntervalArray([(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.arrays.IntervalArray.from_arrays.html