phasik.classes.TemporalNetwork.TemporalNetwork
- class TemporalNetwork[source]
Base class for temporal networks
Temporal networks are networks with time-varying edges. They consist of nodes and edges, and latter can have time-varying weights.
- Variables
nodes (list of (str or int)) – Sorted list of node names. Node names can be either strings or integers, but they all need to be of the same type.
times (list of (int or float)) – Sorted list of times for which we have temporal information
tedges (pandas.DataFrame) – Dataframe containing tedges, also called timestamped data (potentially weighted). Columns are [‘i’, ‘j’, ‘t’, (‘weight’)] and each row represents a tedge.
snapshots (numpy array) – Array of shape (T, N, N) storing the instantaneous values of the adjacency matrix A_{ij}(t).
Methods
N
()Returns the number of nodes
T
()Returns the number of times
__init__
()add_tedges
(tedges_to_add)Adds multiple tedges (optionally weighted)
aggregated_network
([time_indices, output])Returns a time-aggregated network as a networkx.Graph
discard_temporal_info_from_edge
(edge[, ...])Discards temporal information from 'edge' by setting its weight to a constant
discard_temporal_info_from_node
(node[, ...])Discards temporal information from 'node' by setting the weight of its edges to a constant
edge_timeseries
([edges])Returns dict of edge time series.
Returns a list of edges in the aggregated network
from_edge_timeseries
(edge_timeseries[, ...])Creates a TemporalNetwork from a DataFrame of edge timeseries
from_node_timeseries
(node_timeseries[, ...])Creates a temporal network by combining node timeseries into edge timeseries.
Creates a temporal network by combining a static network with edge timeseries
Creates a temporal network by combining a static network with node timeseries
from_static_network_and_tedges
(...[, ...])Creates a temporal network by combining a static network with tedges
from_tedges
(tedges[, normalise])Creates a TemporalNetwork from a dataframe of tedges
has_node
(node)Returns True if node is in the TemporalNetwork
has_tedge
(tedge)Returns True if tedge is in the TemporalNetwork, regardless of its weight
has_time
(time)Returns True if time is in the TemporalNetwork
Returns True if tedges are weighted
Returns a dictionary of neighboring nodes in the aggregate network.
network_at_time
(time_index[, output])Returns the temporal network at time 'time' as a networkx.Graph
Returns the number of edges in the aggregated network
shape
()Returns the shape (N,T) of the TemporalNetwork
tedges_of_edge
(edge[, return_mask, reverse])Returns a filtered DataFrame containing only the tedges of edge 'edge'.
tedges_of_node
(node[, return_mask, reverse])Returns a filtered DataFrame containing only the tedges of node 'node'.
Returns a copy of the temporal network as a PartiallyTemporalNetwork
Attributes
nodes
Returns a list of nodes in the TemporalNetwork
snapshots
Returns a numpy array of snapshots in the TemporalNetwork
tedges
Returns a DataFrame of tedges the TemporalNetwork
times
Returns a list of times in the TemporalNetwork