🍾 Xarray is now 10 years old! 🎉

xarray.IndexVariable.isel

xarray.IndexVariable.isel#

IndexVariable.isel(indexers=None, missing_dims='raise', **indexers_kwargs)[source]#

Return a new array indexed along the specified dimension(s).

Parameters:
  • **indexers ({dim: indexer, ...}) – Keyword arguments with names matching dimensions and values given by integers, slice objects or arrays.

  • missing_dims ({"raise", "warn", "ignore"}, default: "raise") – What to do if dimensions that should be selected from are not present in the DataArray: - “raise”: raise an exception - “warn”: raise a warning, and ignore the missing dimensions - “ignore”: ignore the missing dimensions

Returns:

obj (Array object) – A new Array with the selected data and dimensions. In general, the new variable’s data will be a view of this variable’s data, unless numpy fancy indexing was triggered by using an array indexer, in which case the data will be a copy.