This is a simple example of how tu use the Kernel Density Estimation algorithm implemented in scipy.

Kernel Density Estimation with scipy
glowingpython.blogspot.it