I am using Ubuntu 16, python 3.6, and xarray 0.9.1
Consider the following code:
import xarray as xr
import numpy as np
dims = ['a', 'b']
coords = {'a': range(2), 'b':range(2), 'group': (('a', 'b'), [[0, 0], [0, 1]])}
values = [[0, 0], [0, 0]]
dar = xr.DataArray(values, coords, dims)
dar[dict(group=0)] = 1 # group is only 0 for three of the four elements
expected_values = np.array([[1, 1], [1, 0]])
# yet this raises because all four values are set to 1
assert np.all(np.isclose(dar.values, expected_values))
I suspect trying to assign values in this way using a multi-dimensional coordinate should raise a ValueError as this does: