xarray.DataTree.copy (original) (raw)

DataTree.copy(*, inherit=True, deep=False)[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:

Returns:

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