Last active
October 8, 2017 00:41
-
-
Save jackvial/e0bf3532e3b80fab0d64696601f2437c to your computer and use it in GitHub Desktop.
Python ECDF
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): | |
"""Compute ECDF for a one-dimensional array of measurements.""" | |
# Number of data points: n | |
n = len(data) | |
# x-data for the ECDF: x | |
x = np.sort(data) | |
# y-data for the ECDF: y | |
y = np.arange(1, n+1) / n | |
return x, y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment