I'm trying to figure out the way to properly use map in python so that I can multi-thread my program by Pool.map. Basically I'm running into issues trying to understand how functional python works. I have:
import numpy as np
def maptest(foo,bars):
print foo * bars
main():
matA = np.eye(2)
matB = np.eye(2)
print map((lambda foo: maptest(foo, matB)), matA)
This gives me an output of:
[[ 1. 0.]
[ 0. 0.]]
[[ 0. 0.]
[ 0. 1.]]
[None, None]
when the output I want is simply:
[[1. 0.]
[0. 1.]]
What's going on with the map call I can? This is my first time using map and lambda. I've used lambdify with sympy, but that's all for my functionals experience. Thanks!