class xarray.set_options(**kwargs)

Set options for xarray in a controlled context.

Currently supported options:

  • display_width: maximum display width for repr on xarray objects. Default: 80.
  • arithmetic_join: DataArray/Dataset alignment in binary operations. Default: 'inner'.

You can use set_options either as a context manager:

>>> ds = xr.Dataset({'x': np.arange(1000)})
>>> with xr.set_options(display_width=40):
...     print(ds)
Dimensions:  (x: 1000)
  * x        (x) int64 0 1 2 3 4 5 6 ...
Data variables:

Or to set global options:

>>> xr.set_options(display_width=80)

Initialize self. See help(type(self)) for accurate signature.


__init__(**kwargs) Initialize self.