Is there a numpy max min function?

Is there a numpy function that gives the maximum value for the given numpy array - the minimum value, i.e. numpy.max (a) - numpy.min (a)?

eg.

numpy.xxx([4,3,2, 6] = 4 since max = 6, min = 2, 6 - 4 = 2) 

Reason: increasing performance with max and min will double the iteration of the array (which in my case is 7.5 million or more numbers).

+16
python max numpy min
Feb 16 2018-12-12T00:
source share
1 answer

Indeed, there is such a function - it is called numpy.ptp() for peak to peak.

+28
Feb 16 2018-12-16T00:
source share



All Articles