summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorSanjana M Moodbagil <msanjana9819@gmail.com>2022-09-16 19:25:10 +0000
committerSanjana M Moodbagil <msanjana9819@gmail.com>2022-09-16 19:25:10 +0000
commitb034f6dc33ebfef2e389a7b011c7b7920cc44f68 (patch)
treefaecf99bc2f7a5c7b313ef342a04fcbbcfce24f4 /numpy/core/fromnumeric.py
parent5f94eb858f3e181eccfda2c26db9f0b9167a8156 (diff)
downloadnumpy-b034f6dc33ebfef2e389a7b011c7b7920cc44f68.tar.gz
Added example to np.prod
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index e1c99e61f..fda4d71e0 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -3044,6 +3044,9 @@ def prod(a, axis=None, dtype=None, out=None, keepdims=np._NoValue,
>>> np.prod([[1.,2.],[3.,4.]], axis=1)
array([ 2., 12.])
+ >>> np.prod([[1.,2.,3.],[3.,4.,5.],[1.,3.,5.]], axis=0)
+ array([ 3., 24., 75.])
+
Or select specific elements to include:
>>> np.prod([1., np.nan, 3.], where=[True, False, True])