From e772a1a9bb9626490316e6c9ae8d57cd25cff33c Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Thu, 28 Dec 2017 07:40:57 +0000 Subject: ENH: Allow ptp to take an axis tuple and keepdims --- numpy/core/_methods.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'numpy/core/_methods.py') 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 + ) -- cgit v1.2.1