Skip to content

Commit

Permalink
DOC: Add line clarifying sorting using sort_values() (#60734)
Browse files Browse the repository at this point in the history
fix docs
  • Loading branch information
Impaler343 authored Jan 21, 2025
1 parent 42bf375 commit 31704e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -6890,7 +6890,8 @@ def sort_values(
builtin :meth:`sorted` function, with the notable difference that
this `key` function should be *vectorized*. It should expect a
``Series`` and return a Series with the same shape as the input.
It will be applied to each column in `by` independently.
It will be applied to each column in `by` independently. The values in the
returned Series will be used as the keys for sorting.
Returns
-------
Expand Down
3 changes: 2 additions & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4884,7 +4884,8 @@ def sort_values(
builtin :meth:`sorted` function, with the notable difference that
this `key` function should be *vectorized*. It should expect a
``Series`` and return a Series with the same shape as the input.
It will be applied to each column in `by` independently.
It will be applied to each column in `by` independently. The values in the
returned Series will be used as the keys for sorting.
Returns
-------
Expand Down

0 comments on commit 31704e3

Please sign in to comment.