@@ -58,6 +58,21 @@ cdef class IntervalMixin:
58
58
-------
59
59
bool
60
60
True if the Interval is closed on the left-side.
61
+
62
+ See Also
63
+ --------
64
+ Interval.closed_right : Check if the interval is closed on the right side.
65
+ Interval.open_left : Boolean inverse of closed_left.
66
+
67
+ Examples
68
+ --------
69
+ >>> iv = pd.Interval(0, 5, closed='left')
70
+ >>> iv.closed_left
71
+ True
72
+
73
+ >>> iv = pd.Interval(0, 5, closed='right')
74
+ >>> iv.closed_left
75
+ False
61
76
"""
62
77
return self .closed in (" left" , " both" )
63
78
@@ -72,6 +87,21 @@ cdef class IntervalMixin:
72
87
-------
73
88
bool
74
89
True if the Interval is closed on the left-side.
90
+
91
+ See Also
92
+ --------
93
+ Interval.closed_left : Check if the interval is closed on the left side.
94
+ Interval.open_right : Boolean inverse of closed_right.
95
+
96
+ Examples
97
+ --------
98
+ >>> iv = pd.Interval(0, 5, closed='both')
99
+ >>> iv.closed_right
100
+ True
101
+
102
+ >>> iv = pd.Interval(0, 5, closed='left')
103
+ >>> iv.closed_right
104
+ False
75
105
"""
76
106
return self .closed in (" right" , " both" )
77
107
@@ -86,6 +116,21 @@ cdef class IntervalMixin:
86
116
-------
87
117
bool
88
118
True if the Interval is not closed on the left-side.
119
+
120
+ See Also
121
+ --------
122
+ Interval.open_right : Check if the interval is open on the right side.
123
+ Interval.closed_left : Boolean inverse of open_left.
124
+
125
+ Examples
126
+ --------
127
+ >>> iv = pd.Interval(0, 5, closed='neither')
128
+ >>> iv.open_left
129
+ True
130
+
131
+ >>> iv = pd.Interval(0, 5, closed='both')
132
+ >>> iv.open_left
133
+ False
89
134
"""
90
135
return not self .closed_left
91
136
@@ -100,6 +145,21 @@ cdef class IntervalMixin:
100
145
-------
101
146
bool
102
147
True if the Interval is not closed on the left-side.
148
+
149
+ See Also
150
+ --------
151
+ Interval.open_left : Check if the interval is open on the left side.
152
+ Interval.closed_right : Boolean inverse of open_right.
153
+
154
+ Examples
155
+ --------
156
+ >>> iv = pd.Interval(0, 5, closed='left')
157
+ >>> iv.open_right
158
+ True
159
+
160
+ >>> iv = pd.Interval(0, 5)
161
+ >>> iv.open_right
162
+ False
103
163
"""
104
164
return not self .closed_right
105
165
@@ -124,6 +184,10 @@ cdef class IntervalMixin:
124
184
def length (self ):
125
185
"""
126
186
Return the length of the Interval.
187
+
188
+ See Also
189
+ --------
190
+ Interval.is_empty : Indicates if an interval contains no points.
127
191
"""
128
192
return self .right - self .left
129
193
@@ -140,6 +204,10 @@ cdef class IntervalMixin:
140
204
an :class:`~arrays.IntervalArray` or :class:`IntervalIndex` is
141
205
empty.
142
206
207
+ See Also
208
+ --------
209
+ Interval.length : Return the length of the Interval.
210
+
143
211
Examples
144
212
--------
145
213
An :class:`Interval` that contains points is not empty:
0 commit comments