pandas.Series.reset_index
pandas 3.1.1 · Series and accessors · method
Restore a default positional index. Existing index labels can become columns.
Call syntax
Series.reset_index(level=None, *, drop=False, name=…, inplace=…, allow_duplicates=False)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
level |
Optional Positional or keyword Default None |
int, str, tuple, or list Choose an index level by name or integer position. |
drop |
Optional Keyword only Default False |
bool Choose whether removed labels or levels are kept as data where supported. |
name |
Optional Keyword only |
object Set a name or identify the named object used by the operation. |
inplace |
Optional Keyword only |
bool Choose whether to change the existing object. Where supported, an in-place call typically returns None. |
allow_duplicates |
Optional Keyword only Default False |
bool Choose whether duplicate labels are permitted by the operation. |
Returns
Series or DataFrame or None