1import numpy as np 2 3 4def ecdf(data): 5 x, y = np.sort(data), np.arange(1, len(data)+1) / len(data) 6 return x, y 7 8