The length
attribute of an IntervalArray
object is used to return the length of the intervals of the object as an index.
Note:
IntervalArray
is an object containing interval data such that they are closed on the same side.
IntervalArray.length
This attribute takes no parameter value.
This attribute returns the length of each interval of the IntervalArray
object as an index.
# A code to illustrate the length attribute of an IntervalArray object. # importing the pandas library import pandas as pd # creating the IntervalArray object a = pd.arrays.IntervalArray([pd.Interval(0, 4), pd.Interval(1, 5)]) # printing the IntervalArray object print(a) # obtaining the midpoints print("This length of each interval is: ", a.length)
pandas
library.IntervalArray
object, a
.a
.length
attribute to obtain the length of each interval of a
.RELATED TAGS
CONTRIBUTOR
View all Courses