xarray.DataTree.to_dataset#

DataTree.to_dataset(inherit=True)[source]#

Return the data in this node as a new xarray.Dataset object.

Parameters:

inherit (bool or {"all_coords", "indexes"}, default True) – Controls which coordinates are inherited from parent nodes.

  • True or “indexes”: inherit only indexed coordinates (default).

  • “all_coords”: inherit all coordinates, including non-index coordinates.

  • False: only include coordinates defined at this node.

See also

DataTree.dataset