pandas.Series.str.repeat
pandas 3.1.1 · Series and accessors · method
Repeat each value the given number of times. String repeat repeats the text within each element.
Call syntax
Series.str.repeat(repeats)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
repeats |
Required Positional or keyword |
int or sequence of int Set how many copies of each element to produce. |
Returns
Series or pandas.Index