datatree.DataTree.__getitem__

Attention

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

datatree.DataTree.__getitem__#

DataTree.__getitem__(key: str) DataTree | DataArray[source][source]#

Access child nodes, variables, or coordinates stored anywhere in this tree.

Returned object will be either a DataTree or DataArray object depending on whether the key given points to a child or variable.

Parameters:

key (str) – Name of variable / child within this node, or unix-like path to variable / child within another node.

Returns:

Union[DataTree, DataArray]