Skip to content

Commit

Permalink
fix single pandas index non-dimension coord name
Browse files Browse the repository at this point in the history
  • Loading branch information
benbovy committed Apr 5, 2024
1 parent 3f1d4a7 commit 2083caf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xarray/core/indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def create_variables(
encoding = None

data = PandasIndexingAdapter(self.index, dtype=self.coord_dtype)
var = IndexVariable(self.dim, data, attrs=attrs, encoding=encoding)
var = IndexVariable(self.dim, data, attrs=attrs, encoding=encoding, name=name)
return {name: var}

def to_pandas_index(self) -> pd.Index:
Expand Down

0 comments on commit 2083caf

Please sign in to comment.