Pandas Series: droplevel() function

Series-droplevel() function

The droplevel() function is used to return DataFrame with requested index / column level(s) removed.


Series.droplevel(self, level, axis=0)
Pandas Series droplevel image


Name Description Type/Default Value Required / Optional
level If a string is given, must be the name of a level If list-like, elements must be names or positional indexes of levels. int, str, or list-like Required
axis {0 or ‘index’, 1 or ‘columns’}
Default Value: 0

Returns: DataFrame.droplevel()


Download the Pandas Series Notebooks from here.

Previous: Remove series with specified index labels
Next: Remove Pandas series with duplicate values

Share this Tutorial / Exercise on : Facebook and Twitter