I have the data in .txt
format separated by spaces and line breaks. Here is some of them.
1 2 1082040961
3 4 1082155839
5 2 1082414391
6 7 1082439619
8 7 1082439756
This data represents temporal graphs, G = (u, v, t)
, where u
, v
, and t
means there is an edge from node u
to node v
with timestamp t
.
I want to visualize these data using Python's library pathpy
.
They must be coded like below to add an edge.
t.add_edge('1', '2', 1082040961)
t.add_edge('3', '4', 1082155839)
t.add_edge('5', '2', 1082414391)
t.add_edge('6', '7', 1082439619)
t.add_edge('8', '7', 1082439756)
But there are a lot of edges in the data. So I need a smart way to handle this. How should I code this tuple transformation?