Skip to content

Commit 3415832

Browse files
authored
CLN: .values -> ._values (#32778)
1 parent f444213 commit 3415832

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pandas/core/indexes/category.py

+3
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,11 @@ def _simple_new(cls, values: Categorical, name: Label = None):
243243

244244
@Appender(Index._shallow_copy.__doc__)
245245
def _shallow_copy(self, values=None, name: Label = no_default):
246+
name = self.name if name is no_default else name
247+
246248
if values is not None:
247249
values = Categorical(values, dtype=self.dtype)
250+
248251
return super()._shallow_copy(values=values, name=name)
249252

250253
def _is_dtype_compat(self, other) -> bool:

0 commit comments

Comments
 (0)