igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] U Chicago Undergrad Need Python Directed Graph Help


From: Bradford Boyle
Subject: Re: [igraph] U Chicago Undergrad Need Python Directed Graph Help
Date: Fri, 15 Jan 2016 11:42:27 -0800

What about this:

>>> d = igraph.Graph(directed=True)
>>> d.add_vertices([0, 1])
>>> d.add_edge(0, 1, type='positive', count=2)
>>> d.add_edge(0, 1, type='negative', count=4)

--Bradford

On Fri, Jan 15, 2016 at 11:18 AM, Kevin Hong <address@hidden> wrote:
> Hi,
>
> My name is Kevin Hong, and I am an undergrad who works at the U Chicago
> Knowledge Lab. I am working on a networks analysis project, and I having
> trouble creating one of the graphs using Python iGraph.
>
> I have a MySQL table with the schema (Theme, Cause, Type, Count). There are
> 3 different Types (positive, negative, no effect). I would like to create a
> graph where for a row in our table I would like to create a directed edge
> from Theme to Cause that has count as its weight. I am unsure how I can
> distinguish between the three Types in one iGraph graph. (i.e. (A,B, weight
> = 50, Type = positive) (A,B, weight = 40, Type = negative))
>
> In summary, I am unsure how to create 3 different types of directed weighted
> edges between two vertexes in Python iGraph.
>
> Thank you for the help.
>
> Best,
>
> Kevin
>
> --
> Kevin Hong
> University of Chicago '17
> B.S. Computer Science | B.S. Statistics
> address@hidden | (309) 643-7283
>
> _______________________________________________
> 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]