[SciPy-User] rv_discrete

Ralf Gommers ralf.gommers at gmail.com
Wed Aug 22 05:58:21 EDT 2012


On Wed, Aug 22, 2012 at 11:40 AM, nicky van foreest <vanforeest at gmail.com>wrote:

> Hi,
>
> How can I find out whether a frozen rv is a subclass of rv_discrete or
> rv_continuous. This doesn't work:
>
> X = stats.norm(10, np.sqrt(10))
> print issubclass(X.__class__, stats.rv_continuous)
>

It's not a subclass of either one. But I guess this is what you want:

In [11]: isinstance(X.dist, stats.rv_continuous)
Out[11]: True

In [12]: isinstance(X.dist, stats.rv_discrete)
Out[12]: False

Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20120822/1dd1f136/attachment.html>


More information about the SciPy-User mailing list