In [1]:
import numpy as np
res=map(np.sin,[np.pi/6,np.pi/4,np.pi/2])
list(res)


Out[1]:
[0.49999999999999994, 0.70710678118654746, 1.0]

In [2]:
f = lambda x, y : x + y
f(1,1)


Out[2]:
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]:
[102.56, 97.7, 99.14, 100.03999999999999]

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]:
[0, 2, 8, 34]

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]:
102

In [ ]: