From c514ce14e855101583f2b15586f914b7b2f6c05f Mon Sep 17 00:00:00 2001 From: cmp0xff Date: Mon, 26 May 2025 22:29:11 +0200 Subject: [PATCH] DOC: https://github.com/pandas-dev/pandas/pull/61455#discussion_r2096069007 --- pandas/core/frame.py | 10 +++++----- pandas/core/indexes/base.py | 6 +++--- pandas/core/reshape/merge.py | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index b2c1e38f61f4c..bf919c6fe8a42 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -337,15 +337,15 @@ to SQL left anti join; preserve key order. * right_anti: use only keys from right frame that are not in left frame, similar to SQL right anti join; preserve key order. -on : label or list +on : Hashable or a sequence of the previous Column or index level names to join on. These must be found in both DataFrames. If `on` is None and not merging on indexes then this defaults to the intersection of the columns in both DataFrames. -left_on : label or list, or array-like +left_on : Hashable or a sequence of the previous, or array-like Column or index level names to join on in the left DataFrame. Can also be an array or list of arrays of the length of the left DataFrame. These arrays are treated as if they are columns. -right_on : label or list, or array-like +right_on : Hashable or a sequence of the previous, or array-like Column or index level names to join on in the right DataFrame. Can also be an array or list of arrays of the length of the right DataFrame. These arrays are treated as if they are columns. @@ -7395,7 +7395,7 @@ def value_counts( Parameters ---------- - subset : label or list of labels, optional + subset : Hashable or a sequence of the previous, optional Columns to use when counting unique combinations. normalize : bool, default False Return proportions rather than frequencies. @@ -7546,7 +7546,7 @@ def nlargest( ---------- n : int Number of rows to return. - columns : label or list of labels + columns : Hashable or a sequence of the previous Column label(s) to order by. keep : {'first', 'last', 'all'}, default 'first' Where there are duplicate values: diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 9df0787a4560d..a8a22dd69b69c 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -1913,12 +1913,12 @@ def set_names(self, names, *, level=None, inplace: bool = False) -> Self | None: Parameters ---------- - names : label or list of label or dict-like for MultiIndex + names : Hashable or a sequence of the previous or dict-like for MultiIndex Name(s) to set. .. versionchanged:: 1.3.0 - level : int, label or list of int or label, optional + level : int, Hashable or a sequence of the previous, optional If the index is a MultiIndex and names is not dict-like, level(s) to set (None for all levels). Otherwise level must be None. @@ -2023,7 +2023,7 @@ def rename(self, name, *, inplace: bool = False) -> Self | None: Parameters ---------- - name : label or list of labels + name : Hashable or a sequence of the previous Name(s) to set. inplace : bool, default False Modifies the object directly, instead of creating a new Index or diff --git a/pandas/core/reshape/merge.py b/pandas/core/reshape/merge.py index 68d61da0cf7dd..6de3d5c3f9c09 100644 --- a/pandas/core/reshape/merge.py +++ b/pandas/core/reshape/merge.py @@ -198,15 +198,15 @@ def merge( to SQL left anti join; preserve key order. * right_anti: use only keys from right frame that are not in left frame, similar to SQL right anti join; preserve key order. - on : label or list + on : Hashable or a sequence of the previous Column or index level names to join on. These must be found in both DataFrames. If `on` is None and not merging on indexes then this defaults to the intersection of the columns in both DataFrames. - left_on : label or list, or array-like + left_on : Hashable or a sequence of the previous, or array-like Column or index level names to join on in the left DataFrame. Can also be an array or list of arrays of the length of the left DataFrame. These arrays are treated as if they are columns. - right_on : label or list, or array-like + right_on : Hashable or a sequence of the previous, or array-like Column or index level names to join on in the right DataFrame. Can also be an array or list of arrays of the length of the right DataFrame. These arrays are treated as if they are columns. @@ -536,13 +536,13 @@ def merge_ordered( First pandas object to merge. right : DataFrame or named Series Second pandas object to merge. - on : label or list + on : Hashable or a sequence of the previous Field names to join on. Must be found in both DataFrames. - left_on : label or list, or array-like + left_on : Hashable or a sequence of the previous, or array-like Field names to join on in left DataFrame. Can be a vector or list of vectors of the length of the DataFrame to use a particular vector as the join key instead of columns. - right_on : label or list, or array-like + right_on : Hashable or a sequence of the previous, or array-like Field names to join on in right DataFrame or vector/list of vectors per left_on docs. left_by : column name or list of column names