SHARE
TWEET

Untitled

a guest Dec 12th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import csv
  2. import networkx as nx
  3.  
  4. fi = open('netflow.csv')
  5. csvreader = csv.reader(fi)
  6.  
  7. G = nx.Graph()
  8.  
  9. for l in csvreader:
  10.     ipsrc = l[3]
  11.     ipdst = l[6]
  12.     G.add_edge(ipsrc, ipdst)
  13.  
  14. nx.write_graphml(G, "netflow.graphml")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top