Use a dictionary to handle dimension names in an Xarray DataArray that may change from run-to-run

PHOTO EMBED

Wed Oct 18 2023 01:37:34 GMT+0000 (Coordinated Universal Time)

Saved by @ktyle #python #xarray

dims = Z.dims
dictZ = {dims[1] : [500,700]}
dictZ
Z.sel(dictZ)
content_copyCOPY