You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, numpy.ptp (peak-to-peak: max - min) does not accept the where argument, unlike other reduction functions such as sum, min, max, and mean.
This creates an inconsistency in the API and forces users to pre-mask arrays (e.g., x[mask]) when selectively computing the range of values.
Proposed Enhancement
Extend np.ptp to accept a where parameter, consistent with other reductions. The where mask will be forwarded to both the underlying maximum and minimum reductions.