def ECDF(values):
 x = np.array(values, copy=True)
 x.sort()
 x.shape = np.product(x.shape, axis=0)
 n = x.shape[0]
 y = ((np.arange(n) + 1.0) / n)
 return StepFunction(x, y)

def ECDF ( values ) : x = np . array ( values , copy = True ) x . sort ( ) x . shape = np . product ( x . shape , axis = 0 ) n = x . shape [ 0 ] y = ( ( np . arange ( n ) + 1.0 ) / n ) return StepFunction ( x , y )
return the ecdf of an array as a step function .