Ejemplo n.º 1
0
 def run_test(arr, *args, **kwargs):
   axis = kwargs.pop('axis', None)
   for fn1 in self.array_transforms:
     for fn2 in self.array_transforms:
       arr_arg = fn1(arr)
       axis_arg = fn2(axis) if axis is not None else None
       self.match(
           array_methods.amax(arr_arg, axis=axis_arg, *args, **kwargs),
           np.amax(arr_arg, axis=axis, *args, **kwargs))
       self.match(
           array_methods.amin(arr_arg, axis=axis_arg, *args, **kwargs),
           np.amin(arr_arg, axis=axis, *args, **kwargs))
Ejemplo n.º 2
0
def ptp(a, axis=None, keepdims=None):
    return (array_methods.amax(a, axis=axis, keepdims=keepdims) -
            array_methods.amin(a, axis=axis, keepdims=keepdims))