datatree.DataTree.copy

Contents

Attention

This repository has been archived. Please use xarray.DataTree instead.

datatree.DataTree.copy#

DataTree.copy(deep: bool = False) DataTree[source][source]#

Returns a copy of this subtree.

Copies this node and all child nodes.

If deep=True, a deep copy is made of each of the component variables. Otherwise, a shallow copy of each of the component variable is made, so that the underlying memory region of the new datatree is the same as in the original datatree.

Parameters:

deep (bool, default: False) – Whether each component variable is loaded into memory and copied onto the new object. Default is False.

Returns:

object (DataTree) – New object with dimensions, attributes, coordinates, name, encoding, and data of this node and all child nodes copied from original.

See also

xarray.Dataset.copy, pandas.DataFrame.copy