Say I have an xarray.Dataset
object loaded in using xarray.open_dataset(..., decode_times=False)
that looks like this when printed:
<
NetCDF4 doesn't support all of the multi-dimensional indexing operations supported by NumPy. But does support slicing (which is very fast) and one dimensional indexing (somewhat slower).
Some things to try:
.sel(time=slice(start, end))
) before indexing with 1-dimensional arrays. This should offload the array-based indexing from netCDF4 to Dask/NumPy..chunk()
.If that doesn't work, post a full self-contained example to the xarray issue tracker on GitHub and we can take a look into it in more detail.