Closed
Description
is there a reason the coords
dictionary values cannot be a tuple? I found this fairly baffling to debug when it tripped me up.
# this works
xarray.DataArray(np.random.random((3, 3, 3)),
dims=('one', 'two', 'three'),
coords={
'one': ['four', 'five', 'six'],
}
)
# this throws the following error
# ValueError: dimensions ('four',) must have the same length as the number of data dimensions, ndim=0
xarray.DataArray(np.random.random((3, 3, 3)),
dims=('one', 'two', 'three'),
coords={
'one': ('four', 'five', 'six'),
}
)
even if there was a clearer error it would help quite a bit. As it stands you are thinking, 'what?! four isn't a dimension!'
using 0.8.2