Skip to content

Commit

Permalink
Fixes #223: Correct the call signature to rs.DataSet.reset_index()
Browse files Browse the repository at this point in the history
  • Loading branch information
JBGreisman committed Aug 16, 2024
1 parent 3540259 commit 92c32c3
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion reciprocalspaceship/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,14 @@ def set_index(
)

def reset_index(
self, level=None, drop=False, inplace=False, col_level=0, col_fill=""
self,
level=None,
drop=False,
inplace=False,
col_level=0,
col_fill="",
allow_duplicates=lib.no_default,
names=None,
):
"""
Reset the index or a specific level of a MultiIndex.
Expand All @@ -281,6 +288,12 @@ def reset_index(
col_fill : object
If the columns have multiple levels, determines how the other
levels are named. If None then the index name is repeated.
allow_duplicates : bool
Allow duplicate column labels to be created.
names : int, str, tuple, list
Using the given string, rename the DataSet column which contains the
index data. If the DataSet has a MultiIndex, this has to be a list or
tuple with length equal to the number of levels.
Returns
-------
Expand Down Expand Up @@ -317,6 +330,8 @@ def _handle_cached_dtypes(dataset, columns, drop):
inplace=inplace,
col_level=col_level,
col_fill=col_fill,
allow_duplicates=allow_duplicates,
names=names,
)
_handle_cached_dtypes(self, columns, drop)
return
Expand All @@ -327,6 +342,8 @@ def _handle_cached_dtypes(dataset, columns, drop):
inplace=inplace,
col_level=col_level,
col_fill=col_fill,
allow_duplicates=allow_duplicates,
names=names,
)
dataset._index_dtypes = dataset._index_dtypes.copy()
dataset = _handle_cached_dtypes(dataset, columns, drop)
Expand Down

0 comments on commit 92c32c3

Please sign in to comment.