I have a data frame df
df=
index value
A 1
B 4
C 8
D 3
E 12
F 7
How to find the Empirical Cumulative Distribution Function (ECDF) of each element in the column df['value'] and store the correspnding value in a separate column df['ecdf']. The formula for ECDF is:
Much more documentation about the ECDF can be found here. I am also interested in plotting a line graph for the CDF obtained.
Expected Output:
df=
index value ecdf
A 1 0.1667
B 4 0.5
C 8 0.8333
D 3 0.3333
E 12 1
F 7 0.6667

