pandera.typing.xarray.DataTreeΒΆ

class pandera.typing.xarray.DataTree(dataset=None, children=None, name=None)[source]ΒΆ

Annotation-only generic for xarray.DataTree.

Create a single node of a DataTree.

The node may optionally contain data in the form of data and coordinate variables, stored in the same way as data is stored in an xarray.Dataset.

ParametersΒΆ

datasetDataset, optional

Data to store directly at this node.

childrenMapping[str, DataTree], optional

Any child nodes of this node.

namestr, optional

Name for this node of the tree.

ReturnsΒΆ

DataTree

See AlsoΒΆ

DataTree.from_dict

Attributes

ancestors

All parent nodes and their parent nodes, starting with the most distant.

attrs

Dictionary of global attributes on this node object.

children

Child nodes of this node, stored under a mapping via their names.

chunksizes

Mapping from group paths to a mapping of chunksizes.

coords

Dictionary of xarray.DataArray objects corresponding to coordinate variables

data_vars

Dictionary of DataArray objects corresponding to data variables

dataset

An immutable Dataset-like view onto the data in this node.

depth

Maximum level of this tree.

descendants

Child nodes and all their child nodes.

dims

Mapping from dimension names to lengths.

ds

An immutable Dataset-like view onto the data in this node.

encoding

Dictionary of global encoding attributes on this node object.

groups

Return all groups in the tree, given as a tuple of path-like strings.

has_attrs

Whether or not there are any metadata attributes in this node.

has_data

Whether or not there are any variables in this node.

indexes

Mapping of pandas.Index objects used for label based indexing.

is_empty

False if node contains any data or attrs.

is_hollow

True if only leaf nodes contain data.

is_leaf

Whether this node is a leaf node.

is_root

Whether this node is the tree root.

leaves

All leaf nodes.

level

Level of this node.

lineage

All parent nodes and their parent nodes, starting with the closest.

name

The name of this node.

nbytes

parent

Parent of this node.

parents

All parent nodes and their parent nodes, starting with the closest.

path

Return the file-like path from the root to this node.

root

Root node of the tree

siblings

Nodes with the same parent as this node.

sizes

Mapping from dimension names to lengths.

subtree

Iterate over all nodes in this tree, including both self and all descendants.

subtree_with_keys

Iterate over relative paths and node pairs for all nodes in this tree.

variables

Low level interface to node contents as dict of Variable objects.

width

Number of nodes at this level in the tree.

xindexes

Mapping of xarray Index objects used for label based indexing.

Methods