NodeStateIntervals

Methods

MethodDescription
getGet value for node
itemsIterate over items
maxCalculate the maximum interval in milliseconds for each node.
meanCalculate the mean interval in milliseconds for each node.
medianCalculate the median interval in milliseconds for each node.
minCalculate the minimum interval in milliseconds for each node.
nodesIterate over nodes
sorted_by_idSort results by node id
to_dfConvert results to pandas DataFrame
to_listCollect all intervals in milliseconds into a list for each node.
valuesIterate over values

Method Details

get

Signature: get(node, default=None)

Get value for node

Parameters

NameTypeDefaultDescription
nodeNodeInput-the node
defaultIntervals, optionalNonethe default value. Defaults to None.

Returns

TypeDescription
Intervals, optionalthe value for the node or the default value

items

Iterate over items

max

Calculate the maximum interval in milliseconds for each node.

Returns

TypeDescription
NodeStateOptionI64A NodeState with the computed maximum interval between consecutive timestamps for each node. The maximum is None if there is fewer than 1 interval.

mean

Calculate the mean interval in milliseconds for each node.

Returns

TypeDescription
NodeStateOptionF64A NodeState with the computed mean interval between consecutive timestamps for each node. The mean is None if there is fewer than 1 interval.

median

Calculate the median interval in milliseconds for each node.

Returns

TypeDescription
NodeStateOptionI64A NodeState with the computed median interval between consecutive timestamps for each node. The median is None if there is fewer than 1 interval.

min

Calculate the minimum interval in milliseconds for each node.

Returns

TypeDescription
NodeStateOptionI64A NodeState with the computed minimum interval between consecutive timestamps for each node. The minimum is None if there is fewer than 1 interval.

nodes

Iterate over nodes

Returns

TypeDescription
NodesThe nodes

sorted_by_id

Sort results by node id

Returns

TypeDescription
NodeStateIntervalsThe sorted node state

to_df

Convert results to pandas DataFrame

The DataFrame has two columns, "node" with the node ids and "value" with the corresponding values.

Returns

TypeDescription
DataFramethe pandas DataFrame

to_list

Collect all intervals in milliseconds into a list for each node.

Returns

TypeDescription
list[list[int]]List of intervals in milliseconds for each node.

values

Iterate over values

Returns

TypeDescription
Iterator[Intervals]Iterator over values