I have an Xarray.Dataset with the coordinates ‘range’ and ‘time’.
How can I access the values of coordinate named ‘range’ to add a static scalar like 200 for example?
# imports
import xarray as xr
import numpy as np
time = pd.date_range("2006-02-21", freq="s", periods=4)
print(time)
# create a small xarray
da = xr.DataArray(np.random.randn(4, 4), dims=("range", "time"), coords={"time": time})
# add a coordinate to this array with shifts to apply to each rows
da=da.assign_coords(range=('range', [1.56,5.233,10.98,17.43]))
print(da)
The aimed result should be this:
Coordinates:
* range (range) float64 201.56 205.233 210.98 217.43```
This is not working:
```da.range = da.range + 200```