diff --git a/xarray/core/coordinates.py b/xarray/core/coordinates.py index 85a9d97abeb..f46ff480375 100644 --- a/xarray/core/coordinates.py +++ b/xarray/core/coordinates.py @@ -194,7 +194,7 @@ def to_index(self, ordered_dims: Sequence[Hashable] | None = None) -> pd.Index: return pd.MultiIndex( levels=level_list, # type: ignore[arg-type,unused-ignore] - codes=[list(c) for c in code_list], + codes=code_list, names=names, )