Is there an accepted efficient way to find the range (ie. max value – min value) of a list of numbers in python? I have tried using a loop and I know I can use the min and max functions with subtraction. I am just wondering if there is some kind of built-in that is faster.
Is there an accepted efficient way to find the range (ie. max value –
Share
If you really need high performance, try Numpy. The function
numpy.ptpcomputes the range of values (i.e.max - min) across an array.