Say I have 4 numpy arrays like:
a : np.random.randn(4,4)
which is like
array([[ 0.8087178 , -1.32970726, -0.62254544, 0.82266235],
[-0.57101685, -1.39512136, -0.19650182, 0.46574661],
[-1.06096896, 0.92744505, 1.98807088, 1.11976449],
[-0.0103123 , 1.49460442, -0.16151632, 0.96951708]])
then I have b, c, d also equal np.random.randn(4,4)
Now, suppose I want to know the maximum of for each array location in string, like this:
array([[a, b, d, c],
[b, c, a, a],
[c, a, b, b],
[d, c, a, b]])
How would I do it? lambda function don't seem to work here. I know a loop would work, but is there a batch function that could do this?
More generally, the question would be, how could I apply individual functions to each array element across arrays without using a loop?
Thanks!