navis.network2nx¶
- navis.network2nx(x, threshold=None, group_by=None)[source]¶
Generate NetworkX graph from edge list or adjacency.
- Parameters:
x (pandas.DataFrame) –
Connectivity information:
List of edges (columns: ‘source’, ‘target’, ‘weight’)
Adjacency matrix (pd.DataFrame, rows=sources, columns=targets)
threshold (float | int, optional) – Connections weaker than this will be excluded.
group_by (None | dict, optional) – Provide a dictionary
{group_name: [skid1, skid2, ...]}
to collapse sets of nodes into groups.
- Returns:
NetworkX representation of the network.
- Return type:
networkx.DiGraph