timeflux.nodes.xarray


XArray

This module contains nodes to handle XArray data.

xarray

class timeflux.nodes.xarray.Transpose(dims)[source]

Bases: timeflux.core.node.Node

Transpose dimensions of a DataArray.

This node reorders the dimensions of a DataArray object to dims.

Variables:
  • i (Port) – default data input, expects DataArray.

  • o (Port) – default output, provides DataArray.

Parameters:

dims (list, None) – By default, reverse the dimensions. Otherwise, reorder the dimensions to this order.

Instantiate the node.

update()[source]

Update the input and output ports.

class timeflux.nodes.xarray.ToDataFrame(index_dim='time')[source]

Bases: timeflux.core.node.Node

Convert XArray to DataFrame.

This node converts a XArray into a flat DataFrame with simple index given by dimension in index_dim and eventually MultiIndex columns (nb_levels = n_dim -1, where n_dim is the number of dimensions of the XArray in input ).

Variables:
  • i (Port) – default data input, expects DataArray.

  • o (Port) – default output, provides DataFrame.

Parameters:

index_dim (str, time) – Name of the dimension to set the index of the DataFrame.

Instantiate the node.

update()[source]

Update the input and output ports.