Skip to content

Commit be99673

Browse files
benbovyTomNicholas
authored andcommitted
fix multi-index edge case
1 parent 07b9856 commit be99673

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

xarray/core/coordinates.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,9 @@ def create_coords_with_default_indexes(
995995
variable = as_variable(obj, name=name, auto_convert=False)
996996

997997
if variable.dims == (name,):
998+
# still needed to convert to IndexVariable first due to some
999+
# pandas multi-index edge cases.
1000+
variable = variable.to_index_variable()
9981001
idx, idx_vars = create_default_index_implicit(variable, all_variables)
9991002
indexes.update({k: idx for k in idx_vars})
10001003
variables.update(idx_vars)

0 commit comments

Comments
 (0)