[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Loading graphs into python-igraph

From: Eric Sun
Subject: [igraph] Loading graphs into python-igraph
Date: Thu, 16 Oct 2008 17:04:03 -0700


I used to use igraph exclusively in R, but I’m migrating to Python.  I’m having trouble loading my graph data (which resides in a separate file) into Python-igraph.

Before, in R, I had a file with directed edge-lists,like so:
etc., and loaded it into R with read.table() and then graph.data.frame(graphdata, directed=TRUE)

I’m trying to port this to Python, but not having much success:
>>> graph = igraph.load('testfile')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/igraph/__init__.py", line 2101, in read
  File "build/bdist.linux-x86_64/egg/igraph/__init__.py", line 1098, in Read
IOError: unknown file format: None

I found the documentation for Graph.Read: http://cneurocvs.rmki.kfki.hu/igraph/doc/python/igraph.Graph-class.html#Read
but it doesn’t discuss the specifics of the formats.  
I also tried using the format on http://cneurocvs.rmki.kfki.hu/igraph/doc/html/ch04s01.html
but that gave the same error.

Could someone direct me to documentation on the format I need to use to load graphs using igraph.load() in Python?

Thanks very much in advance!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]