How to use numpy.prod() in Python

numpy.prod() multiplies each element in a numpy.array over a given axis. For example, multiplying each element in the array [1 2 3] results in 1*2*3 which returns 6.

Solution for How to use numpy.prod() in Python : You can use numpy.prod() to multiply each element in a NumPy array Call numpy.prod(a, axis=None) with an array as a to calculate the product of array elements over a given axis. By default, axis is None which will calculate the product of all the elements in the array a.


how-to-use-numpy-prod-in-python