ExtensionArray.repeat(self, repeats, axis=None)
[source]
Repeat elements of a ExtensionArray.
Returns a new ExtensionArray where each element of the current ExtensionArray is repeated consecutively a given number of times.
Parameters: |
|
---|---|
Returns: |
|
See also
Series.repeat
Index.repeat
numpy.repeat
numpy.ndarray
.ExtensionArray.take
>>> cat = pd.Categorical(['a', 'b', 'c']) >>> cat [a, b, c] Categories (3, object): [a, b, c] >>> cat.repeat(2) [a, a, b, b, c, c] Categories (3, object): [a, b, c] >>> cat.repeat([1, 2, 3]) [a, b, b, c, c, c] Categories (3, object): [a, b, c]
© 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.api.extensions.ExtensionArray.repeat.html