Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Deprecations
Bug Fixes
~~~~~~~~~

- Fix a major performance regression in :py:meth:`Coordinates.to_index` (and
consequently :py:meth:`Dataset.to_dataframe`) caused by converting the cached
code ndarrays into Python lists (:issue:`11305`).


Documentation
~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, # type: ignore[arg-type,unused-ignore]
names=names,
)

Expand Down
Loading