I am trying to calculate the empirical cumulative distribution of images in Python. What is the best practice in doing so? And also I need the result to be stored in an array so that I can use it in further steps of my analysis.
I am using this function and I am not sure if it is the right way to do it:
`def ecdf(data):
x = np.sort(data.flatten())
n = x.size
y = np.arange(1, n+1) / n
return (x,y)`