ENH: Add "where" argument to reduction functions that are missing it
![](https://secure.gravatar.com/avatar/6c746c93bad1aa2312e48e9973657bd9.jpg?s=120&d=mm&r=g)
The following reduction functions receive a "where" argument: - https://numpy.org/doc/stable/reference/generated/numpy.max.html - https://numpy.org/doc/stable/reference/generated/numpy.min.html - https://numpy.org/doc/stable/reference/generated/numpy.sum.html - https://numpy.org/doc/stable/reference/generated/numpy.prod.html - https://numpy.org/doc/stable/reference/generated/numpy.mean.html - https://numpy.org/doc/stable/reference/generated/numpy.var.html - https://numpy.org/doc/stable/reference/generated/numpy.std.html and their nan* counterparts, where applicable. Feature request: Add "where" argument to - https://numpy.org/doc/stable/reference/generated/numpy.ptp.html - https://numpy.org/doc/stable/reference/generated/numpy.average.html - https://numpy.org/doc/stable/reference/generated/numpy.median.html - https://numpy.org/doc/stable/reference/generated/numpy.quantile.html - https://numpy.org/doc/stable/reference/generated/numpy.percentile.html - https://numpy.org/doc/stable/reference/generated/numpy.nanmedian.html and their nan* counterparts, where applicable. ptp should be especially straightforward, since it's just max - min.
![](https://secure.gravatar.com/avatar/6c746c93bad1aa2312e48e9973657bd9.jpg?s=120&d=mm&r=g)
This also applies to - https://numpy.org/doc/stable/reference/generated/numpy.argmax.html - https://numpy.org/doc/stable/reference/generated/numpy.argmin.html and their nan* counterparts. An `initial` argument could be added to handle the empty case, as with np.max and np.min.
![](https://secure.gravatar.com/avatar/6c746c93bad1aa2312e48e9973657bd9.jpg?s=120&d=mm&r=g)
This also applies to - https://numpy.org/doc/stable/reference/generated/numpy.argmax.html - https://numpy.org/doc/stable/reference/generated/numpy.argmin.html and their nan* counterparts. An `initial` argument could be added to handle the empty case, as with np.max and np.min.
participants (1)
-
Carlos Martin