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) thanks Nicky
On Wed, Aug 22, 2012 at 11:40 AM, nicky van foreest <vanforeest@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
Hi Ralf, Thanks. Nicky On 22 August 2012 11:58, Ralf Gommers <ralf.gommers@gmail.com> wrote:
On Wed, Aug 22, 2012 at 11:40 AM, nicky van foreest <vanforeest@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
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
participants (2)
-
nicky van foreest -
Ralf Gommers