3
$\begingroup$

I have some data points for which I would like to show the density using Python, but the package SciPy is not working for Python 3.3.

I am looking for a solution to be able to plot some data in the shape of a normal density. I do not know how to get the nice drawing. When I sort the data points, it would be a cumulative function right?

So, given that there is no density() function available, what is the best way to plot something that will make a nice "normal-ish" graph.

In R I would simply use:

plot(density(data))

EDIT: So I am looking for a statistical solution rather than a software solution. What is the easiest way to make a density (plot) without having a density function available.

$\endgroup$
1
  • $\begingroup$ If you're sure that your data are normal, why not just write the density as the normal Gaussian denisty where the mean is approximated by the sample mean and the variance by the sample variance? $f(x|\mu, \sigma)=\frac{1}{\sqrt{2\pi\sigma^2}}\exp\bigl(-\frac{(x-\mu)^2}{2\sigma^2}\bigr) $ $\endgroup$
    – Sycorax
    Mar 24, 2013 at 17:21

0