You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing in a name or names arguments to Index.copy doesn't set the name on the resulting index. This fails to work as the docs indicate on both Index and MultiIndex.
The user's name parameter is getting overwritten. Here's how to fix it in the code:
diff --git a/pandas/indexes/base.py b/pandas/indexes/base.py
index f430305..72c44ee 100644
--- a/pandas/indexes/base.py
+++ b/pandas/indexes/base.py
@@ -629,7 +629,7 @@ class Index(IndexOpsMixin, StringAccessorMixin, PandasObject):
name = name or deepcopy(self.name)
else:
new_index = self._shallow_copy()
- name = self.name
+ name = name or self.name
if name is not None:
names = [name]
if names:
Passing in a name or names arguments to Index.copy doesn't set the name on the resulting index. This fails to work as the docs indicate on both Index and MultiIndex.
The text was updated successfully, but these errors were encountered: