Skip to content

PERF: Remove unnecessary copies in sorting functions (#33917) #34192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jun 3, 2020
2 changes: 1 addition & 1 deletion pandas/core/sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def ensure_key_mapped(values, key: Optional[Callable], levels=None):
from pandas.core.indexes.api import Index

if not key:
return values.copy()
return values

if isinstance(values, ABCMultiIndex):
return ensure_key_mapped_multiindex(values, key, level=levels)
Expand Down