Reputation: 29
I have two list A = [0.5,0.34.75 .... 1] and B = [0.52,0.44,0.75 ....,0.9].
The length of A and B is different. The values of A and B are between 0 and 1. I tried to generate their PDFs (Probability Distribution Functions) in same figure in the following way:
x = pd.Series(A, name="x variable")
y = pd.Series(B, name="x variable")
df = pd.DataFrame({
'A': x,
'B': y,
})
ax = df.plot.kde()
However it does not generate pdf. How can i generate pdf?
Edit: I want to generate two pdf curves in the same figure. I found this way to do that in an online tutorial but i don't know the distribution of the data so i can't simply chose random normal distribution or any other distribution.
(1): I have no idea how to estimate the pdf.
(2): it generates following results which are not pdfs.
(3): On x-axis i want number and on y-axis i want probability.
Upvotes: 0
Views: 1741
Reputation: 126
In your code example you're using KDE, thus non-parametric estimation of the probability density function, which i'm assuming you mean by PDF, using Gaussian kernel.
Pandas kde
function allows to choose bandwidth method and evaluation points, both by parameters.
Pandas actually uses the SciPy implementation of kde, please refer to the documentation to better understand the implementation and how to choose parameters .
Upvotes: 1