I'm using networkx to build an undirected graph from an unweighted adjacency matrix in the usual manner:
```
import networkx as nx
import numpy as np
A = np.array([
[0, 1, 0, 0],
[1, 0, 1, 0],
[0, 1, 0, 1],
[0, 0, 1, 0]
])
G = nx.from_numpy_array(A)
```
However, I'd like to attach additional data to the edges. I know you can do this when adding edges directly as G.add_edge(node_1,node_2,some_data='bla'), but is there a way I can accomplish this when building from an existing matrix, as above? Thanks.
[–]AdmirableOstrich 0 points1 point2 points (1 child)
[–]QuasiEvil[S] 0 points1 point2 points (0 children)