I want to multiply all elements in a numpy array. If there's an array like [1, 2, 3, 4, 5]
, I want to get value of 1 * 2 * 3 * 4 * 5
.
I tried this by making my own method, but size of array is very large, it takes very longs time to calculate because I'm using numpy it would be helpful if numpy supports this operation.
I tried to find out through numpy documents, but I failed. Is there a method which does this operation? If there is, is there a way to get values along a rank in an matrix?