[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: |
Thu, 21 Jan 2016 10:28:00 -0800 |
In the [python-igraph tutorial][0], there is a section "igraph and the
outside world" that lists several output formats that graphs can be
saved to.
--Bradford
[0]: http://igraph.org/python/doc/tutorial/tutorial.html
On Thu, Jan 21, 2016 at 7:46 AM, Kevin Hong <address@hidden> wrote:
> 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
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>