Convert the edge weigth into the edge_attr #2621
-
Suppose I have a weighted graph constructed like below
How can I converted it into a unweighted graph with the original weight as its edge_attr. In this case, the data would becomes like
Any help would be appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Check out |
Beta Was this translation helpful? Give feedback.
-
As the @wsad1 pointed out, we can achieve this conviently by using
|
Beta Was this translation helpful? Give feedback.
Check out
dense_to_sparse
. It converts a dense adjacency matrix to a sparse adjacency matrix as described here.