[SciPy-user] Error in scipy.stats.poisson
John Reid
j.reid at mail.cryst.bbk.ac.uk
Wed Aug 29 11:13:14 EDT 2007
Hi,
Should the following code work?
import scipy.stats as S
r=S.poisson(4)
r.pdf(2)
I get the following error:
C:\apps\Python25\Lib\site-packages\scipy\stats\distributions.py in
pdf(self, x)
104 self.dist = dist
105 def pdf(self,x):
--> 106 return self.dist.pdf(x,*self.args,**self.kwds)
107 def cdf(self,x):
108 return self.dist.cdf(x,*self.args,**self.kwds)
<type 'exceptions.AttributeError'>: poisson_gen instance has no
attribute 'pdf'
S.poisson does have a pmf function not a pdf function. Is this the cause?
John.
More information about the SciPy-User
mailing list