From 15c00070fbd7a1a4abd7017e85ba6a398e3b831c Mon Sep 17 00:00:00 2001 From: ptype Date: Wed, 24 Feb 2021 12:37:16 +0000 Subject: [PATCH 1/2] Terminology consistency smallest -> lowest --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 1b7c02cd7a05b..45df3a6d986cb 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -8374,7 +8374,7 @@ def rank( How to rank NaN values: * keep: assign NaN rank to NaN values - * top: assign smallest rank to NaN values if ascending + * top: assign lowest rank to NaN values if ascending * bottom: assign highest rank to NaN values if ascending. ascending : bool, default True From 9cc546d90e282a4029a2aaf2f48dbf289f2eedaf Mon Sep 17 00:00:00 2001 From: ptype Date: Wed, 24 Feb 2021 12:40:57 +0000 Subject: [PATCH 2/2] Remove confusing language Top/bottom give the lowest/highest rank, regardless of if ascending is True or False --- pandas/core/generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 45df3a6d986cb..f8138e9de1f5b 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -8374,8 +8374,8 @@ def rank( How to rank NaN values: * keep: assign NaN rank to NaN values - * top: assign lowest rank to NaN values if ascending - * bottom: assign highest rank to NaN values if ascending. + * top: assign lowest rank to NaN values + * bottom: assign highest rank to NaN values ascending : bool, default True Whether or not the elements should be ranked in ascending order.