igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Cannot convert directed graph into undirected graph using p


From: Gábor Csárdi
Subject: Re: [igraph] Cannot convert directed graph into undirected graph using python
Date: Fri, 21 Feb 2014 20:21:14 -0500

More seriously, in Python, objects are usually mutable, and their member functions modify them in place. E.g. see this:

>>> l=[1,2,3,4]
>>> p=l.append([5,6,6])
>>> print p
None

igraph's Python interface conforms to this standard. g.to_undirected() converts g to undirected in place, and returns None.

Gabor


On Fri, Feb 21, 2014 at 7:07 PM, Gábor Csárdi <address@hidden> wrote:
On Fri, Feb 21, 2014 at 6:55 PM, Salvatore Palomino <address@hidden> wrote:
Hello!

I am trying to convert my directed graph g into an undirected graph using to_undirected().

<< g = GraphBase.Read_Pajek("C:/Users/Palomino/Downloads/109Senate-Rows.net")
<< g = g.to_undirected(False)
<< print g
None

I don't know why it returns None. Can you help me out?

What should it return? The result of the conversion is in g, it does it in place.

G.
 
 

Thanks!!!





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




reply via email to

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