What is your issue?
When coords are specified in tuple format, their names are silently ignored when dims names are also specified.
The following expression yields a DataArray that retains no reference to the otherwise specified coords of a, b, and c, in favor of the positionally-associated names of dims, x, y, and z.
DataArray(
data=[[[1]], [[2]], [[3]]],
dims=["x", "y", "z"],
coords=[("a", [5, 6, 7]), ("b", [8]), ("c", [9])]
)
The result is:
<xarray.DataArray (x: 3, y: 1, z: 1)> Size: 24B
array([[[1]],
[[2]],
[[3]]])
Coordinates:
* x (x) int64 24B 5 6 7
* y (y) int64 8B 8
* z (z) int64 8B 9
Even though this behavior is documented, I think the user should be warned that the coordinate names do not match the dimension names and have been overridden.
What is your issue?
When coords are specified in tuple format, their names are silently ignored when
dimsnames are also specified.The following expression yields a DataArray that retains no reference to the otherwise specified coords of a, b, and c, in favor of the positionally-associated names of
dims, x, y, and z.The result is:
Even though this behavior is documented, I think the user should be warned that the coordinate names do not match the dimension names and have been overridden.