Re: [igraph] clustering coefficients for bipartite networks

From:

Simone Gabbriellini

Subject:

Re: [igraph] clustering coefficients for bipartite networks

Date:

Tue, 1 Feb 2011 16:08:17 +0100

I am really facing difficulties in translating the code from R... Maybe, it
would be better to start from scratch in python.
I am trying to find, for every pair (u,v) of nodes of the same set, how many
neighbors of the other sets they have in common divided by the sum of unique
neighbors of u and v.
is there a simple way to accomplish this task?
If I am right, this should produce, for every node, a list of values as long as
the number of pairs of nodes in a set. I then can use a running mean to
calculate the average value of the list.
best,
Simone
Il giorno 29/gen/2011, alle ore 11.50, Tamás Nepusz ha scritto:
>> I don't think I can define functions on the fly like in R (but maybe I am
>> wrong)
> You can, see the lambda keyword:
>
>http://diveintopython.org/power_of_introspection/lambda_functions.html
>
> You can also define functions within functions, so if your auxiliary function
> is longer (but you won't use it from anywhere else), you can define it inside
> your original function.
>
> I don't know exactly what the difference is between the different *apply
> functions in R (lapply, sapply, apply), but I believe that Python's map()
> function does something similar. But even better, use list comprehensions if
> possible:
>
>http://docs.python.org/tutorial/datastructures.html#list-comprehensions
>
> --
> T.
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
>http://lists.nongnu.org/mailman/listinfo/igraph-help