今天在看书的时候,看到了这样的一条语句:
if isinstance(value,int) or isinstance(value,float): split_function=lambda row:row[column]>=value
对其中的lambda这个函数表示很不明白,于是看了看Python文档,文档中解释如下:
log2=lambda x:log(x)/log(2)
就是定义了一个以2为底的对数函数。这个例子是有参数的,还有一种情况是没有参数的:
>>>bar=lambda :‘this is a bar‘ >>>print bar this is a bar
原文:http://www.cnblogs.com/itdyb/p/5014052.html