[SciPy-dev] patch for rv_discrete
Osei Poku
opoku at ece.cmu.edu
Sun Nov 20 19:28:23 EST 2005
Hi,
I have attached a patch to fix this problem.
http://www.scipy.net/roundup/scipy/issue242
I simply add the missing function. I think this should be fine.
This patch is for
scipy/Lib/stats/distributions.py
Osei
-------------- next part --------------
Index: distributions.py
===================================================================
--- distributions.py (revision 1448)
+++ distributions.py (working copy)
@@ -2941,6 +2941,12 @@
except KeyError:
return 0.0
+def _drv_pmf(self, xk, *args):
+ try:
+ return self.P[xk]
+ except KeyError:
+ return 0.0
+
def _drv_cdf(self, xk, *args):
indx = argmax((self.xk>xk))-1
return self.F[self.xk[indx]]
More information about the SciPy-Dev
mailing list