Skip to content

Commit b4ee138

Browse files
committed
Deprecate mapper argument in rename #44627
1 parent c58d8ee commit b4ee138

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5192,7 +5192,7 @@ def rename(
51925192
2 2 5
51935193
4 3 6
51945194
"""
5195-
return super().rename(
5195+
return super()._rename(
51965196
mapper=mapper,
51975197
index=index,
51985198
columns=columns,

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ def squeeze(self, axis=None):
989989
# ----------------------------------------------------------------------
990990
# Rename
991991

992-
def rename(
992+
def _rename(
993993
self: NDFrameT,
994994
mapper: Renamer | None = None,
995995
*,

pandas/core/series.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -4468,10 +4468,8 @@ def align(
44684468

44694469
def rename(
44704470
self,
4471-
mapper=None,
4472-
*,
44734471
index=None,
4474-
columns=None,
4472+
*,
44754473
axis=None,
44764474
copy=True,
44774475
inplace=False,
@@ -4546,7 +4544,7 @@ def rename(
45464544
if mapper is None:
45474545
mapper = index
45484546
if callable(mapper) or is_dict_like(mapper):
4549-
return super().rename(
4547+
return super()._rename(
45504548
mapper, copy=copy, inplace=inplace, level=level, errors=errors
45514549
)
45524550
else:

0 commit comments

Comments
 (0)