summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSimon Gasse <sgasse@users.noreply.github.com>2020-03-26 22:09:34 +0100
committerSimon Gasse <sgasse@users.noreply.github.com>2020-07-18 13:10:10 +0200
commit4ec1dbd8864363f77902d77e3d044a26eead31be (patch)
tree06a55d49ad04b2d6e3ded1f01b91578c3c3eeff7 /doc
parent6ef5ec39cdfaf77aa4600ec2e3bf9f679a4fd527 (diff)
downloadnumpy-4ec1dbd8864363f77902d77e3d044a26eead31be.tar.gz
ENH: Add where argument to several functions
Harmonize the signature of np.mean, np.var np.std, np.any, np.all, and their respective nd.array methods with np.sum by adding a where argument, see gh-15818.
Diffstat (limited to 'doc')
-rw-r--r--doc/release/upcoming_changes/15852.new_feature.rst24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/release/upcoming_changes/15852.new_feature.rst b/doc/release/upcoming_changes/15852.new_feature.rst
new file mode 100644
index 000000000..12965e57b
--- /dev/null
+++ b/doc/release/upcoming_changes/15852.new_feature.rst
@@ -0,0 +1,24 @@
+``where`` keyword argument for ``numpy.all`` and ``numpy.any`` functions
+------------------------------------------------------------------------
+The keyword argument ``where`` is added and allows to only consider specified
+elements or subaxes from an array in the Boolean evaluation of ``all`` and
+``any``. This new keyword is available to the functions ``all`` and ``any``
+both via ``numpy`` directly or in the methods of ``numpy.ndarray``.
+
+Any broadcastable Boolean array or a scalar can be set as ``where``. It
+defaults to ``True`` to evaluate the functions for all elements in an array if
+``where`` is not set by the user. Examples are given in the documentation of
+the functions.
+
+
+``where`` keyword argument for ``numpy`` functions ``mean``, ``std``, ``var``
+-----------------------------------------------------------------------------
+The keyword argument ``where`` is added and allows to limit the scope in the
+caluclation of ``mean``, ``std`` and ``var`` to only a subset of elements. It
+is available both via ``numpy`` directly or in the methods of
+``numpy.ndarray``.
+
+Any broadcastable Boolean array or a scalar can be set as ``where``. It
+defaults to ``True`` to evaluate the functions for all elements in an array if
+``where`` is not set by the user. Examples are given in the documentation of
+the functions.