![](https://secure.gravatar.com/avatar/68d20bbfa68c7d49d858bbce0618aef3.jpg?s=120&d=mm&r=g)
3 Jun
2012
3 Jun
'12
6:20 a.m.
Hi all, I need to sample a random number from a distribution whose probability density function I specify myself. Is that possible using scipy.stats? Here is what I have already: import scipy.stats as st class my_pdf(st.rv_continuous): def _pdf(self,x): return x*x/10.0 my_cv = my_pdf(name='my_pdf') Can I now somehow sample a random number from my_cv? Thanks in advance! Daniel