xarray.DataTree.copy#
- 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
inherit (
bool
) – Whether inherited coordinates defined on parents of this node should also be copied onto the new tree. Only relevant if the parent of this node is not yet, and “Inherited coordinates” appear in its repr.deep (
bool
) – 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