Pandas Series: repeat() function
Repeat elements of a Pandas series
The repeat() function is used to repeat elements of a Series.
Returns a new Series where each element of the current Series is repeated consecutively a given number of times.
Series.repeat(self, repeats, axis=None)
|Name||Description||Type/Default Value||Required / Optional|
|repeats||The number of repetitions for each element. This should be a non-negative integer. Repeating 0 times will return an empty Series.||int or array of ints||Required|
|axis||Must be None. Has no effect but is accepted for compatibility with numpy.||Default Value: None||Required|
Returns: Series- Newly created Series with repeated elements.
Download the above Notebook from here.
- New Content published on w3resource :
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework