diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-12-28 07:40:57 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-12-28 07:57:21 +0000 |
commit | e772a1a9bb9626490316e6c9ae8d57cd25cff33c (patch) | |
tree | 4d91ea15b1cf54602887547bd0b82da188b34ed7 /numpy/core/_methods.py | |
parent | 7bb2d5a8f0219aa5acb5fda05929f1a0745a1883 (diff) | |
download | numpy-e772a1a9bb9626490316e6c9ae8d57cd25cff33c.tar.gz |
ENH: Allow ptp to take an axis tuple and keepdims
Diffstat (limited to 'numpy/core/_methods.py')
-rw-r--r-- | numpy/core/_methods.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/core/_methods.py b/numpy/core/_methods.py index c05316d18..0f928676b 100644 --- a/numpy/core/_methods.py +++ b/numpy/core/_methods.py @@ -142,3 +142,10 @@ def _std(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False): ret = um.sqrt(ret) return ret + +def _ptp(a, axis=None, out=None, keepdims=False): + return um.subtract( + umr_maximum(a, axis, None, out, keepdims), + umr_minimum(a, axis, None, None, keepdims), + out + ) |