I want to use xr.where to get index:(lat,lon) which contain y<1 from this xarray dataset:
import xarray as xr
y = xr.DataArray(
0.1 * np.arange(12).reshape(3, 4),
dims=["lat", "lon"],
coords={"lat": np.arange(3), "lon": 10 + np.arange(4)},
name="sst",
)
When I tried
xr.where(y<1,y.lat,y.lon)
output is:
array([[ 0, 0, 0, 0],
[ 1, 1, 1, 1],
[ 2, 2, 12, 13]])
That is difficult for me to interpret.
Any suggestions?
Many thanks