[Scipy-svn] r5076 - trunk/scipy/stats

scipy-svn@scip... scipy-svn@scip...
Wed Nov 12 20:42:36 CST 2008


Author: josef
Date: 2008-11-12 20:42:35 -0600 (Wed, 12 Nov 2008)
New Revision: 5076

Modified:
   trunk/scipy/stats/distributions.py
Log:
add missing keyword argument in stats of frozen distribution

Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py	2008-11-13 02:38:10 UTC (rev 5075)
+++ trunk/scipy/stats/distributions.py	2008-11-13 02:42:35 UTC (rev 5076)
@@ -105,7 +105,7 @@
         self.args = args
         self.kwds = kwds
         self.dist = dist
-    def pdf(self,x):
+    def pdf(self,x):    #raises AttributeError in frozen discrete distribution
         return self.dist.pdf(x,*self.args,**self.kwds)
     def cdf(self,x):
         return self.dist.cdf(x,*self.args,**self.kwds)
@@ -119,8 +119,10 @@
         return self.dist.rvs(*self.args,**kwds)
     def sf(self,x):
         return self.dist.sf(x,*self.args,**self.kwds)
-    def stats(self):
-        return self.dist.stats(*self.args,**self.kwds)
+    def stats(self,moments='mv'):
+        kwds = self.kwds
+        kwds.update({'moments':moments})
+        return self.dist.stats(*self.args,**kwds)
     def moment(self,n):
         return self.dist.moment(n,*self.args,**self.kwds)
     def entropy(self):



More information about the Scipy-svn mailing list