Skip to content

Commit

Permalink
small simplification of rename from pydata#3532
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty committed Nov 16, 2019
1 parent 52d4845 commit 32d1ad9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2657,13 +2657,7 @@ def _rename_indexes(self, name_dict, dims_set):
continue
if isinstance(v, pd.MultiIndex):
new_names = [name_dict.get(k, k) for k in v.names]
index = pd.MultiIndex(
v.levels,
v.labels,
v.sortorder,
names=new_names,
verify_integrity=False,
)
index = v.rename(names=new_names)
else:
index = v.rename(new_name)
indexes[new_name] = index
Expand Down

0 comments on commit 32d1ad9

Please sign in to comment.