NodeStateIntervals
Methods
| Method | Description |
|---|---|
get | Get value for node |
items | Iterate over items |
max | Calculate the maximum interval in milliseconds for each node. |
mean | Calculate the mean interval in milliseconds for each node. |
median | Calculate the median interval in milliseconds for each node. |
min | Calculate the minimum interval in milliseconds for each node. |
nodes | Iterate over nodes |
sorted_by_id | Sort results by node id |
to_df | Convert results to pandas DataFrame |
to_list | Collect all intervals in milliseconds into a list for each node. |
values | Iterate over values |
Method Details
get
Signature: get(node, default=None)
Get value for node
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
node | NodeInput | - | the node |
default | Intervals, optional | None | the default value. Defaults to None. |
Returns
| Type | Description |
|---|---|
| Intervals, optional | the value for the node or the default value |
items
Iterate over items
max
Calculate the maximum interval in milliseconds for each node.
Returns
| Type | Description |
|---|---|
| NodeStateOptionI64 | A 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
| Type | Description |
|---|---|
| NodeStateOptionF64 | A 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
| Type | Description |
|---|---|
| NodeStateOptionI64 | A 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
| Type | Description |
|---|---|
| NodeStateOptionI64 | A 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
| Type | Description |
|---|---|
| Nodes | The nodes |
sorted_by_id
Sort results by node id
Returns
| Type | Description |
|---|---|
| NodeStateIntervals | The 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
| Type | Description |
|---|---|
| DataFrame | the pandas DataFrame |
to_list
Collect all intervals in milliseconds into a list for each node.
Returns
| Type | Description |
|---|---|
| list[list[int]] | List of intervals in milliseconds for each node. |
values
Iterate over values
Returns
| Type | Description |
|---|---|
Iterator[Intervals] | Iterator over values |