> Hi, I think csv is not directly supported, although probably only 3
> lines of code after you have the edge list.
>  
>  

CSV files can probably be read with Python’s csv.DictReader class (from the CSV 
module) combined with igraph.Graph.DictList():

import csv
import igraph

reader = csv.DictReader(open(“file.csv”), dialect=“excel”)
g = igraph.Graph.DictList(edges=reader)

This assumes that the CSV file contains column headers and the columns named 
“source” and “target” contain the source and target vertex names. If your 
columns are named differently, use the edge_foreign_keys=… keyword argument of 
Graph.DictList.

—  
T.
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to