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: Kevin Hong
Subject: Re: [igraph] U Chicago Undergrad Need Python Directed Graph Help
Date: Thu, 21 Jan 2016 09:46:13 -0600

Thanks for the help!

I have created the graphs, but they are very large, so  I would like to save them to a file and read from that file each time I need to use. What would be the best way to do that in Python iGraph?

Many Thanks,

Kevin

On Fri, Jan 15, 2016 at 1:42 PM, Bradford Boyle <address@hidden> wrote:
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
>

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



--
Kevin Hong
University of Chicago '17
B.S. Computer Science | B.S. Statistics
address@hidden | (309) 643-7283

reply via email to

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