The is_empty
attribute of an IntervalArray
object is used to check if the intervals in the object are empty.
An
IntervalArray
is an object containing interval data such that they are closed on the same side.
The is_empty
attribute has the following syntax:
IntervalArray.is_empty
Since it is an attribute, is_empty
takes no parameter value.
The is_empty
attribute returns an array of boolean values (True
or False
) indicating which of the intervals are empty.
# A code to illustrate the is_empty attribute of an IntervalArray object. # importing the pandas library import pandas as pd # creating the IntervalArray objects a = pd.arrays.IntervalArray([pd.Interval(0, 0), pd.Interval(1, 5)]) # printing the IntervalArray print(a) # getting the empty and non-empty intervals print(a.is_empty)
RELATED TAGS
CONTRIBUTOR
View all Courses