From 31704e3a69a65f0508c40c4881453757334c217e Mon Sep 17 00:00:00 2001 From: Pranav Raghu <73378019+Impaler343@users.noreply.github.com> Date: Wed, 22 Jan 2025 00:41:34 +0530 Subject: [PATCH] DOC: Add line clarifying sorting using sort_values() (#60734) fix docs --- pandas/core/frame.py | 3 ++- pandas/core/generic.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 863465ca1565c..af66bb54610f1 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -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 ------- diff --git a/pandas/core/generic.py b/pandas/core/generic.py index de7fb3682fb4f..e0a4f9d9c546a 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -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 -------