Skip to content

Instantly share code, notes, and snippets.

@sergeymong
Last active January 5, 2021 13:38
Show Gist options
  • Save sergeymong/de8a0efe9cdae1c152475db6cbe418e8 to your computer and use it in GitHub Desktop.
Save sergeymong/de8a0efe9cdae1c152475db6cbe418e8 to your computer and use it in GitHub Desktop.
[ECDF] Empirical Cumulative Distribution Function #EDA #Python #Numpy
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