[SciPy-User] Porting matlab's ksdensity to scipy

Tadas Vilkeliskis vilkeliskis.t@gmail....
Mon Jul 19 11:20:15 CDT 2010


Hi guys!

I am trying to port the code written in matlab to python and I got
stuck with matlab's ksdensity function. The matlab code I have looks
something like this:

[f, x] = ksdensity(values)

I used scipy's gaussian_kde to achieve the same result; however, I
modified the matlab's code to f = ksdensity(values, x) and where x are
fixed values. When x are fixed gaussian_kde works fine, but this is
not what I need. I want to select x based on the input values as in
[f, x] = ksdensity(values) which returns x based on the input. Is
there a way to do this in scipy? For instance, if I have input values
[0, 1, 40, 2, 3, 2] how do I get the range of x values?

Thank you very much.

Tadas


More information about the SciPy-User mailing list