Last active
January 5, 2021 13:38
-
-
Save sergeymong/de8a0efe9cdae1c152475db6cbe418e8 to your computer and use it in GitHub Desktop.
[ECDF] Empirical Cumulative Distribution Function #EDA #Python #Numpy
This file contains 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(column: list[int]): | |
"""Compute ECDF for a one-dimensional array of measurements.""" | |
# Number of data points: n | |
n = len(column) | |
# x-data for the ECDF: x | |
x = np.sort(column) | |
# y-data for the ECDF: y | |
y = np.arange(1, 1 + n) / n | |
return x, y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment