exa.common.helpers.data_helper.add_data_array

Contents

exa.common.helpers.data_helper.add_data_array#

add_data_array(ds, da, name=None)#

Add data array da to dataset ds.

Unlike the default xarray command, preserves metadata of the dataset.

Parameters:
  • ds (Dataset) – Dataset to add to.

  • da (DataArray) – DataArray to add

  • name (str | None) – name under which da can be accessed inside ds. By default, uses the name property of da.

Returns:

The updated dataset.

Return type:

Dataset