[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] clustering coefficients for bipartite networks
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] clustering coefficients for bipartite networks |
Date: |
Sat, 29 Jan 2011 11:50:32 +0100 |
> 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.