Pandas Series: explode() function
Explode list-likes including lists, tuples, Series, and np.ndarray
The explode() function is used to transform each element of a list-like to a row, replicating the index values.
Series.explode(self) → 'Series'
Returns: Series- Exploded lists to rows; index will be duplicated for these rows.
This routine will explode list-likes including lists, tuples, Series, and np.ndarray. The result dtype of the subset rows will be object. Scalars will be returned unchanged. Empty list-likes will result in a np.nan for that row.
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