[Scipy-svn] r6378 - trunk/scipy/stats
scipy-svn at scipy.org
scipy-svn at scipy.org
Sat May 8 04:44:54 EDT 2010
Author: rgommers
Date: 2010-05-08 03:44:54 -0500 (Sat, 08 May 2010)
New Revision: 6378
Modified:
trunk/scipy/stats/distributions.py
Log:
DOC: Remove scale parameter for discrete dists, and replace pdf with pmf.
Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py 2010-05-08 08:44:39 UTC (rev 6377)
+++ trunk/scipy/stats/distributions.py 2010-05-08 08:44:54 UTC (rev 6378)
@@ -84,6 +84,10 @@
"""pdf(x, %(shapes)s, loc=0, scale=1)
Probability density function.
"""
+_doc_pmf = \
+"""pmf(x, %(shapes)s, loc=0, scale=1)
+ Probability mass function.
+"""
_doc_cdf = \
"""cdf(x, %(shapes)s, loc=0, scale=1)
Cumulative density function.
@@ -211,10 +215,30 @@
# Reuse common content between continous and discrete docs, change some minor
# bits.
docdict_discrete = docdict.copy()
+
+docdict_discrete['pmf'] = _doc_pmf
+_doc_disc_methods = ['rvs', 'pmf', 'cdf', 'sf', 'ppf', 'isf', 'stats', 'entropy', 'fit']
+for obj in _doc_disc_methods:
+ docdict_discrete[obj] = docdict_discrete[obj].replace(', scale=1', '')
+docdict_discrete.pop('pdf')
+
+_doc_allmethods = ''.join([docdict_discrete[obj] for obj in
+ _doc_disc_methods])
+docdict_discrete['allmethods'] = docheaders['methods'] + _doc_allmethods
+
docdict_discrete['longsummary'] = _doc_default_longsummary.replace(\
'Continuous', 'Discrete')
-docdict_discrete['frozennote'] = _doc_default_frozen_note.replace('continuous',
- 'discrete')
+_doc_default_frozen_note = \
+"""
+Alternatively, the object may be called (as a function) to fix the shape and
+location parameters returning a "frozen" continuous RV object:
+
+rv = %(name)s(%(shapes)s, loc=0)
+ - Frozen RV object with the same methods but holding the given shape and
+ location fixed.
+"""
+docdict_discrete['frozennote'] = _doc_default_frozen_note
+
docdict_discrete['example'] = _doc_default_example.replace('[0.9,]',
'Replace with reasonable value')
More information about the Scipy-svn
mailing list