1

everyone, I have a generic values distribution. I post the graph.

enter image description here

Is there a way to generate a CDF from these values? Using sns I can create a graph:

enter image description here

My goal is to assign a value to the y-axis and take a value from the x-axis from the CDF. I'm searching online but can't find a method that doesn't require going through curve normalisation.

1 Answers1

0

I'm not sure of the exact data format, but something like numpy.cumsum will take a numpy array that represents a PDF and turn it into an array that represents the CDF.

From there, with your array of p and cdf it is straightforward to find the p value that gives the cdf (which is what I understand you are looking for) with some interpolation with "nearest" as the type of interpolation (see the documentation on scipy.interpolate.interp1d for example).

alexpiers
  • 696
  • 5
  • 12