[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Language remmendations
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] Language remmendations |
Date: |
Fri, 30 Jan 2009 23:46:28 +0100 |
> I have downloaded the documentation for the R version of igraph
> package. However, I have not been able to locate anything
> specifically for the 2.5 version of Python. Does that mean that the
> calls on functions are essentially the same?
Not exactly, but there are no huge differences. The most notable difference is
that in Python, igraph's
functionality is mostly implemented as methods on instances of a Graph object,
while you just simply
call functions in R. So, in Python, you do something like this:
>>> from igraph import *
>>> g = Graph([(0,1), (1,2), (2, 0), (0,3)])
>>> print g.diameter()
(Note that "diameter" is a method of the newly created Graph object, not an
independent function of
its own).
At any point in Python, you can simply type help(Graph) to get the
documentation of the Graph
object which encapsulates most of igraph's functionality. (Of course this works
only if you executed
"from igraph import *" before to import igraph's objects into the main
namespace). Note that the list
of Graph methods is fairly long; if you are looking for the documentation of a
specific method, you
can call help() with that specific method.
By the way, the full API of igraph's Python interface is to be found here:
http://cneurocvs.rmki.kfki.hu/igraph/doc/python/
The best starting points are the documentation for the Graph and GraphBase
classes:
http://cneurocvs.rmki.kfki.hu/igraph/doc/python/igraph.Graph-class.html
http://cneurocvs.rmki.kfki.hu/igraph/doc/python/igraph.GraphBase-class.html
(Note that Graph is inherited from GraphBase and you shouldn't use GraphBase
directly)
I'm in the process of writing a tutorial for the Python interface; it should be
ready in a week or so,
please let me know if you want to take a look at it before the next release.
> Also, the R documentation I have is at least half a year old, which
> may make a difference, given the fair amount of activity on this list.
The most recent stable version of igraph is 0.5.1; if your R docs are for that
version, then that's fine.
> For instance, would it be advisable to drop Python altogether and exclusively
> work
> with a combination of Netlogo and R? Or is the versatility of Python useful?
I'm not really familiar with NetLogo; if you feel that connecting NetLogo with
R can be done without
too much effort, then I think it's better for you to go with them as you know
both of these tools. On
the other hand, I use Python extensively and I do all my network-related
research using Python and
igraph's Python interface - but I know that the docs for the Python interface
could be made better
(and I'm working on it).
--
Tamas