I've build an array like:
a = [1,2,3,4]
b = eye(4)
c = np.where(b*(1/a) == 0,1,b*(1/a))
r = c*a
# Print Result:
array([[1., 2., 3., 4.],
[1., 1., 3., 4.],
[1., 2., 1., 4.],
[1., 2., 3., 1.]])
So at next step I'd like to perform something like row wise multiplication to get something like:
array([[24.], # This means 1*2*3*4
[12.], # 1*1*3*4
[8.], # 1*2*1*4
[6.]]) # 1*2*3*1
# Or concisely:
array([24,12,8,6])
# In general, for n elements:
array([[x_11., --------- x_1n.],
[x_21., --------- x_2n.],
[ ],
[x_n1., --------- x_nn.]])
And what would be better option in time terms.