igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Loading graphs into python-igraph


From: Eric Sun
Subject: Re: [igraph] Loading graphs into python-igraph
Date: Thu, 23 Oct 2008 13:50:33 -0700

Thanks Tamas, format=’edgelist’ solved the problem.

Another thing I’m wondering about:  is there any way to load a graph in Python-igraph that’s not in an external file?
Igraph.load() and Graph.Read() seem to only be able to support an external file.

Is there any way to load a series of edgelists that’s stored as a Python array (or some other Python data structure), other than dumping it to a file and reading it back in again?

Thanks,
Eric

On 10/17/08 12:40 AM, "Tamas Nepusz" <address@hidden> wrote:

Hi,

> I’m trying to port this to Python, but not having much success:
> >>> graph = igraph.load('testfile')
> [...]
> IOError: unknown file format: None
Please try to replace commas in your file with spaces. When reading
directly from a file, igraph uses the routines of the C core and it
expects whitespace between vertex indices. If igraph still does not
recognise the file format, you can also try to force it to use the
edgelist reader:

graph = igraph.load('testfile', format='edgelist')

--
T.



_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help


reply via email to

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