From c1213e39f48dedcdebdaef43b348605942f66def Mon Sep 17 00:00:00 2001 From: gabsmoreira Date: Fri, 15 May 2020 15:20:10 -0300 Subject: [PATCH] add note to explain columns parameter inside rename_axis() --- pandas/core/generic.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 85b6a8431617a..c1c659ffdc17f 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -1012,6 +1012,9 @@ def rename_axis(self, mapper=lib.no_default, **kwargs): index, columns : scalar, list-like, dict-like or function, optional A scalar, list-like, dict-like or functions transformations to apply to that axis' values. + Note that the ``columns`` parameter is not allowed if the + object is a Series. This parameter only apply for DataFrame + type objects. Use either ``mapper`` and ``axis`` to specify the axis to target with ``mapper``, or ``index``