Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
bagrow
· 2y ago · 0 comments
The best way to compute the empirical CDF (ECDF) is by sorting the data:
N = len(data) X = sorted(data) Y = np.arange(N)/N plt.plot(X,Y)
Technically, you should plot this with `plt.step`.
Comments
[–]
andrewla
2y ago
scipy even has a built-in method (scipy.stats.ecdf) for doing exactly this.
[–]
vvanirudh
2y ago
Neat! That is so simple and in hindsight, makes a lot of sense. Thanks!