179
179
class IntervalArray (IntervalMixin , ExtensionArray ):
180
180
"""
181
181
Pandas array for interval data that are closed on the same side.
182
+
182
183
Parameters
183
184
----------
184
185
data : array-like (1-dimensional)
@@ -193,6 +194,7 @@ class IntervalArray(IntervalMixin, ExtensionArray):
193
194
Copy the input data.
194
195
verify_integrity : bool, default True
195
196
Verify that the IntervalArray is valid.
197
+
196
198
Attributes
197
199
----------
198
200
left
@@ -202,6 +204,7 @@ class IntervalArray(IntervalMixin, ExtensionArray):
202
204
length
203
205
is_empty
204
206
is_non_overlapping_monotonic
207
+
205
208
Methods
206
209
-------
207
210
from_arrays
@@ -211,18 +214,21 @@ class IntervalArray(IntervalMixin, ExtensionArray):
211
214
overlaps
212
215
set_closed
213
216
to_tuples
217
+
214
218
See Also
215
219
--------
216
220
Index : The base pandas Index type.
217
221
Interval : A bounded slice-like interval; the elements of an IntervalArray.
218
222
interval_range : Function to create a fixed frequency IntervalIndex.
219
223
cut : Bin values into discrete Intervals.
220
224
qcut : Bin values into equal-sized Intervals based on rank or sample quantiles.
225
+
221
226
Notes
222
227
-----
223
228
See the `user guide
224
229
<https://pandas.pydata.org/pandas-docs/stable/user_guide/advanced.html#intervalindex>`__
225
230
for more.
231
+
226
232
Examples
227
233
--------
228
234
A new ``IntervalArray`` can be constructed directly from an array-like of
@@ -231,6 +237,7 @@ class IntervalArray(IntervalMixin, ExtensionArray):
231
237
<IntervalArray>
232
238
[(0, 1], (1, 5]]
233
239
Length: 2, dtype: interval[int64, right]
240
+
234
241
It may also be constructed using one of the constructor
235
242
methods: :meth:`IntervalArray.from_arrays`,
236
243
:meth:`IntervalArray.from_breaks`, and :meth:`IntervalArray.from_tuples`.
@@ -1979,13 +1986,13 @@ def repeat(
1979
1986
>>> cat = pd.Categorical(["a", "b", "c"])
1980
1987
>>> cat
1981
1988
['a', 'b', 'c']
1982
- Categories (3, object ): ['a', 'b', 'c']
1989
+ Categories (3, str ): ['a', 'b', 'c']
1983
1990
>>> cat.repeat(2)
1984
1991
['a', 'a', 'b', 'b', 'c', 'c']
1985
- Categories (3, object ): ['a', 'b', 'c']
1992
+ Categories (3, str ): ['a', 'b', 'c']
1986
1993
>>> cat.repeat([1, 2, 3])
1987
1994
['a', 'b', 'b', 'c', 'c', 'c']
1988
- Categories (3, object ): ['a', 'b', 'c']
1995
+ Categories (3, str ): ['a', 'b', 'c']
1989
1996
"""
1990
1997
nv .validate_repeat ((), {"axis" : axis })
1991
1998
left_repeat = self .left .repeat (repeats )
0 commit comments