MCPcopy
hub / github.com/pydata/xarray / update

Method update

xarray/core/dataset.py:5647–5676  ·  view source on GitHub ↗

Update this dataset's variables with those from another dataset. Just like :py:meth:`dict.update` this is a in-place operation. For a non-inplace version, see :py:meth:`Dataset.merge`. Parameters ---------- other : Dataset or mapping Variables wi

(self, other: CoercibleMapping)

Source from the content-addressed store, hash-verified

5645 return result
5646
5647 def update(self, other: CoercibleMapping) -> None:
5648 """Update this dataset's variables with those from another dataset.
5649
5650 Just like :py:meth:`dict.update` this is a in-place operation.
5651 For a non-inplace version, see :py:meth:`Dataset.merge`.
5652
5653 Parameters
5654 ----------
5655 other : Dataset or mapping
5656 Variables with which to update this dataset. One of:
5657
5658 - Dataset
5659 - mapping {var name: DataArray}
5660 - mapping {var name: Variable}
5661 - mapping {var name: (dimension name, array-like)}
5662 - mapping {var name: (tuple of dimension names, array-like)}
5663
5664 Raises
5665 ------
5666 ValueError
5667 If any dimensions would have inconsistent sizes in the updated
5668 dataset.
5669
5670 See Also
5671 --------
5672 Dataset.assign
5673 Dataset.merge
5674 """
5675 merge_result = dataset_update_method(self, other)
5676 self._replace(inplace=True, **merge_result._asdict())
5677
5678 def merge(
5679 self,

Callers 15

__setitem__Method · 0.95
mainFunction · 0.45
conf.pyFile · 0.45
decode_cf_variablesFunction · 0.45
_encode_coordinatesFunction · 0.45
_get_iris_argsFunction · 0.45
_iris_obj_to_attrsFunction · 0.45
convert_calendarFunction · 0.45
_normalize_argsFunction · 0.45
_temp_dataarrayFunction · 0.45
scatterFunction · 0.45

Calls 2

_replaceMethod · 0.95
dataset_update_methodFunction · 0.90

Tested by 15

test_datarray_scatterFunction · 0.36
test_lazy_importFunction · 0.36
test_coords_modifyMethod · 0.36
test_sel_fancyMethod · 0.36
test_updateMethod · 0.36
test_to_and_from_dictMethod · 0.36
test_to_and_from_dictMethod · 0.36