0

I am new to python. I need to display a pyvis graph to visualize the relation between two numbers. I am not able to get the correct graph during iteration. Multiple empty graphs are printed for each iteration in the loop. How to print all the values relation in one graph? What mistake am i doing here? Any help would be appreciated. Thanks in advance !

Code:

 for X,Y in zip(df['SESSION1'],df['SESSION2']):
        print(X,Y)
        n = Network()
        n.add_node(X)
        n.add_node(Y)
        n.show("graph.html")

    

Example : 14 -> 14 should be displayed in graph format and similarly all values in one chart.

Output:

X   Y
14 14
14 20
14 28
14 34
19 54
14 23
14 43
14 66
14 36
13 1
19 98
Kishan
  • 334
  • 2
  • 16

0 Answers0