Skip to content

Commit

Permalink
PERF-#6669: Avoid one extra 'copy()' call for 'Series.reset_index' (#…
Browse files Browse the repository at this point in the history
…6670)

Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
  • Loading branch information
anmyachev authored Oct 30, 2023
1 parent e12b217 commit 763bf8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modin/pandas/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,9 @@ def reset_index(
obj.name = name
from .dataframe import DataFrame

return DataFrame(obj).reset_index(
# Here `query_compiler` is passed instead of `obj` to avoid unnecessary `copy()`
# inside `DataFrame` constructor
return DataFrame(query_compiler=obj._query_compiler).reset_index(
level=level,
drop=drop,
inplace=inplace,
Expand Down

0 comments on commit 763bf8a

Please sign in to comment.