xarray.DataArray.to_netcdf (original) (raw)

DataArray.to_netcdf(path=None, mode='w', format=None, group=None, engine=None, encoding=None, unlimited_dims=None, compute=True, invalid_netcdf=False, auto_complex=None)[source]#

Write DataArray contents to a netCDF file.

Parameters:

Returns:

store (bytes or Delayed or None) –

Notes

Only xarray.Dataset objects can be written to netCDF files, so the xarray.DataArray is converted to a xarray.Dataset object containing a single variable. If the DataArray has no name, or if the name is the same as a coordinate name, then it is given the name"__xarray_dataarray_variable__".

[netCDF4 backend only] netCDF4 enums are decoded into the dataarray dtype metadata.