Closed
Description
Right now,
>>> coords_l, coords_r = [0, 1, 2], [1, 2, 3]
>>> missing_3 = xr.DataArray([11, 12, 13], [(dim, coords_l)])
>>> missing_0 = xr.DataArray([21, 22, 23], [(dim, coords_r)])
>>> together = xr.concat([missing_3, missing_0], dim='x')
>>> together
<xarray.DataArray 'missing_3' (x: 6)>
array([11, 12, 13, 21, 22, 23])
Coordinates:
* x (x) int64 0 1 2 1 2 3
>>> together.sel(x=1)
<xarray.DataArray 'missing_3' (x: 2)>
array([12, 21])
Coordinates:
* x (x) int64 1 1
Would it be OK to introduce a kwarg ("replace"?) that replaces cells of identical coordinates from right to left?
That would render
>>> together
<xarray.DataArray 'missing_3' (x: 6)>
array([11, 21, 22, 23])
Coordinates:
* x (x) int64 0 1 2 3
Some people might even want to drop all cells with coordinate collisions (probably not us). If that's the case then the kwarg would be ternary.....
Metadata
Metadata
Assignees
Labels
No labels