Haven't been able to find any information on this. If I have two m x n matrices of identical dimension, is there a way to apply an element-wise function in numpty on them? To illustrate my meaning:
Custom function is F(x,y)
First Matrix:
array([[ a, b],
[ c, d],
[ e, f]])
Second Matrix:
array([[ g, h],
[ i, j],
[ k, l]])
Is there a way to use the above two matrices in numpy to get the desired output below
array([[ F(a,g), F(b,h)],
[ F(c,i), F(d,j)],
[ F(e,k), F(f,l)]])
I know I could just do nested for
statements, but I'm thinking there may be a cleaner way