In [1]:
import numpy as np
res=map(np.sin,[np.pi/6,np.pi/4,np.pi/2])
list(res)
Out[1]:
In [2]:
f = lambda x, y : x + y
f(1,1)
Out[2]:
In [3]:
Celsius = [39.2, 36.5, 37.3, 37.8]
Fahrenheit = map(lambda x: (float(9)/5)*x + 32, Celsius)
list(Fahrenheit)
Out[3]:
In [16]:
fib = [0,1,1,2,3,5,8,13,21,34,55]
result = filter(lambda x: x % 2==0, fib)
list(result)
Out[16]:
In [29]:
from functools import reduce
f = lambda a,b: a if (a > b) else b
reduce(f, [47,11,42,102,13])
Out[29]:
In [ ]: