I have a multi-variable function and i would like to use the map() function with it.
Example:
def f1(a, b, c):
return a+b+c
map(f1, [[1,2,3],[4,5,6],[7,8,9]])
itertools.starmap made for this:
import itertools
def func1(a, b, c):
return a+b+c
print list(itertools.starmap(func1, [[1,2,3],[4,5,6],[7,8,9]]))
Output:
[6, 15, 24]