[SciPy-User] binom pdf error

Antonio Ingargiola tritemio at gmail.com
Fri Jul 22 17:31:11 EDT 2011


Hi to the list,

I got an error using the pdf method on the binom distribution. Same error
happens on scipy 0.8 and scipy 0.9 (respectively ubuntu distribution and
pythonxy on windows).

The error is the following:

In [1]: from scipy.stats.distributions import binom

In [2]: b = binom(20,0.8)

In [3]: b.rvs()
Out[3]: 17

In [4]: b.pdf(2)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

C:\Users\anto\.xy\startups\<ipython console> in <module>()

C:\Python26\lib\site-packages\scipy\stats\distributions.pyc in pdf(self, x)
    333
    334     def pdf(self, x):    #raises AttributeError in frozen discrete
distribution
--> 335         return self.dist.pdf(x, *self.args, **self.kwds)
    336
    337     def cdf(self, x):

AttributeError: 'binom_gen' object has no attribute 'pdf'

In [5]:


Is this known problem? How can I get the binomial pdf, is there a
workaround?

Many thanks,
Antonio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20110722/8a4167b7/attachment.html>


More information about the SciPy-User mailing list