I am trying to calculate the "excess" as well as other statistics from a numpy array. Calculating Min, Max, Average and Standard Deviation is easy, as I just did.
import arcpy arr = arcpy.RasterToNumPyArray(input_Raster) x = arr print 'Min =', x.min() print 'Max =', x.max() print 'Mean =', x.mean() print 'Standard Deviation =', x.std()
What outputs:
Min = 1.87895 Max = 16.8343 Mean = 8.03462 Standard Deviation = 1.52192
But this method does not work for Kurtos! How i tried
print 'Kurtosis =', x.kurtosis()
And I get: AttributeError: the object 'numpy.ndarray' does not have the attribute 'kurtosis'
What would be the simplest code I could use to include in my own to calculate the result of kurtosis? Thank you
source share