Created
October 26, 2020 16:42
-
-
Save maximtrp/4c3ee77cc40f3aba634c1649a1c8a948 to your computer and use it in GitHub Desktop.
Simple ECDF in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ecdf(data, num=100): | |
y = np.linspace(0, 100, num) | |
x = np.percentile(data, y) | |
return x, y | |
def ecdf_plot(data, ax=None): | |
x, y = ecdf(data) | |
return ax.plot(x, y) if ax is not None else plt.plot(x, y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment