Documentation error in numpy.random.logseries
numpy.random.logseries(p, size=None) but the parameters section, Parameters: loc : float scale : float > 0. size : {tuple, int} Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Notice that p <> loc and what about scale. I'll file a ticket unless I am mission something, Which should it be loc or p What about scale. There is no numpy-dev list right? Should this list be used or the scipy-dev list> Vincent
On Sat, Jun 26, 2010 at 2:41 PM, Vincent Davis
numpy.random.logseries(p, size=None)
but the parameters section, Parameters: loc : float scale : float > 0. size : {tuple, int} Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn.
Notice that p <> loc and what about scale.
I'll file a ticket unless I am mission something, Which should it be loc or p What about scale.
I was looking at this page http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.logseries.h... To partially answer my own question np.random.logseries(p=.923456789, size=(3, 2)) array([[31, 1], [ 2, 38], [ 1, 1]]) "loc" is not valid, "scale" is not valid
There is no numpy-dev list right? Should this list be used or the scipy-dev list>
Vincent
On Sat, Jun 26, 2010 at 4:47 PM, Vincent Davis
On Sat, Jun 26, 2010 at 2:41 PM, Vincent Davis
wrote: numpy.random.logseries(p, size=None)
but the parameters section, Parameters: loc : float scale : float > 0. size : {tuple, int} Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn.
Notice that p <> loc and what about scale.
I'll file a ticket unless I am mission something, Which should it be loc or p What about scale.
I was looking at this page http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.logseries.h...
To partially answer my own question np.random.logseries(p=.923456789, size=(3, 2)) array([[31, 1], [ 2, 38], [ 1, 1]])
"loc" is not valid, "scale" is not valid
this might be a copy-paste error, logseries is tested against scipy.stats.logser I will check it, but I think you are right and loc, scale should be replaced in the docs by the explanation of p. numpy-discussion is the right list for this. Josef
There is no numpy-dev list right? Should this list be used or the scipy-dev list>
Vincent
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Sat, Jun 26, 2010 at 1:41 PM, Vincent Davis
numpy.random.logseries(p, size=None)
but the parameters section, Parameters: loc : float scale : float > 0. size : {tuple, int} Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn.
Notice that p <> loc and what about scale.
I'll file a ticket unless I am mission something, Which should it be loc or p What about scale.
The source is opaque (to me; Cython?) so unless you can decipher it, test actual behavior and document that - my guess is that p is short for "parameters" and is intended to be a two-element array_like containing both the loc and scale parameters, but that's the way it should be documented, not with some unprecedented reference to loc and scale when the signature specifies p, but as I said, check that first. There is no numpy-dev list right? Should this list be used or the
scipy-dev list>
That's a good Q: this is definitely a "bug" in the doc (loc and scale shouldn't be documented as such when they're not explicitly in the function signature), in which case scipy-dev is the proper place to post, but if it turns out to be a bug in the code also, then this is the proper place, since all numpy devs are subscribed here, and numpy users should know about potential bugs (numpy devs will correct me if I'm wrong). DG
Vincent _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Mathematician: noun, someone who disavows certainty when their uncertainty set is non-empty, even if that set has measure zero. Hope: noun, that delusive spirit which escaped Pandora's jar and, with her lies, prevents mankind from committing a general suicide. (As interpreted by Robert Graves)
On Sat, Jun 26, 2010 at 4:58 PM, David Goldsmith
On Sat, Jun 26, 2010 at 1:41 PM, Vincent Davis
wrote: numpy.random.logseries(p, size=None)
but the parameters section, Parameters: loc : float scale : float > 0. size : {tuple, int} Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn.
Notice that p <> loc and what about scale.
I'll file a ticket unless I am mission something, Which should it be loc or p What about scale.
The source is opaque (to me; Cython?) so unless you can decipher it, test actual behavior and document that - my guess is that p is short for "parameters" and is intended to be a two-element array_like containing both the loc and scale parameters, but that's the way it should be documented, not with some unprecedented reference to loc and scale when the signature specifies p, but as I said, check that first.
np.source(stats.distributions.logser_gen)
class logser_gen(rv_discrete): def _rvs(self, pr): return mtrand.logseries(pr,size=self._size) def _argcheck(self, pr): return (pr > 0) & (pr < 1) def _pmf(self, k, pr): return -pr**k * 1.0 / k / log(1-pr) p is a probability between in (0,1), just a mistake in the documentation.
There is no numpy-dev list right? Should this list be used or the scipy-dev list>
That's a good Q: this is definitely a "bug" in the doc (loc and scale shouldn't be documented as such when they're not explicitly in the function signature), in which case scipy-dev is the proper place to post, but if it turns out to be a bug in the code also, then this is the proper place, since all numpy devs are subscribed here, and numpy users should know about potential bugs (numpy devs will correct me if I'm wrong).
I think question about the substance/content of the docstrings should always go to the mailing list of the corresponding function. Josef
DG
Vincent _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Mathematician: noun, someone who disavows certainty when their uncertainty set is non-empty, even if that set has measure zero.
Hope: noun, that delusive spirit which escaped Pandora's jar and, with her lies, prevents mankind from committing a general suicide. (As interpreted by Robert Graves)
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Sat, Jun 26, 2010 at 3:04 PM,
On Sat, Jun 26, 2010 at 4:58 PM, David Goldsmith
wrote: On Sat, Jun 26, 2010 at 1:41 PM, Vincent Davis
wrote: numpy.random.logseries(p, size=None)
but the parameters section, Parameters: loc : float scale : float > 0. size : {tuple, int} Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn.
Thanks, I'll file a ticket Vincent
Notice that p <> loc and what about scale.
I'll file a ticket unless I am mission something, Which should it be loc or p What about scale.
The source is opaque (to me; Cython?) so unless you can decipher it, test actual behavior and document that - my guess is that p is short for "parameters" and is intended to be a two-element array_like containing both the loc and scale parameters, but that's the way it should be documented, not with some unprecedented reference to loc and scale when the signature specifies p, but as I said, check that first.
np.source(stats.distributions.logser_gen)
class logser_gen(rv_discrete): def _rvs(self, pr): return mtrand.logseries(pr,size=self._size) def _argcheck(self, pr): return (pr > 0) & (pr < 1) def _pmf(self, k, pr): return -pr**k * 1.0 / k / log(1-pr)
p is a probability between in (0,1), just a mistake in the documentation.
There is no numpy-dev list right? Should this list be used or the scipy-dev list>
That's a good Q: this is definitely a "bug" in the doc (loc and scale shouldn't be documented as such when they're not explicitly in the function signature), in which case scipy-dev is the proper place to post, but if it turns out to be a bug in the code also, then this is the proper place, since all numpy devs are subscribed here, and numpy users should know about potential bugs (numpy devs will correct me if I'm wrong).
I think question about the substance/content of the docstrings should always go to the mailing list of the corresponding function.
Josef
DG
Vincent _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Mathematician: noun, someone who disavows certainty when their uncertainty set is non-empty, even if that set has measure zero.
Hope: noun, that delusive spirit which escaped Pandora's jar and, with her lies, prevents mankind from committing a general suicide. (As interpreted by Robert Graves)
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Sat, Jun 26, 2010 at 5:12 PM, Vincent Davis
On Sat, Jun 26, 2010 at 3:04 PM,
wrote: On Sat, Jun 26, 2010 at 4:58 PM, David Goldsmith
wrote: On Sat, Jun 26, 2010 at 1:41 PM, Vincent Davis
wrote: numpy.random.logseries(p, size=None)
but the parameters section, Parameters: loc : float scale : float > 0. size : {tuple, int} Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn.
Thanks, I'll file a ticket
Don't file a ticket, just edit the docs. It's just the docstring not the source the Return is also wrong samples : {ndarray, scalar} where the values are all integers in [0, n]. sample values are greater or equal to one, but unbound above
stats.logser.pmf(np.arange(10000, 10005),0.99999) array([ 7.85931402e-06, 7.85844959e-06, 7.85758532e-06, 7.85672123e-06, 7.85585731e-06])
Josef
Vincent
Notice that p <> loc and what about scale.
I'll file a ticket unless I am mission something, Which should it be loc or p What about scale.
The source is opaque (to me; Cython?) so unless you can decipher it, test actual behavior and document that - my guess is that p is short for "parameters" and is intended to be a two-element array_like containing both the loc and scale parameters, but that's the way it should be documented, not with some unprecedented reference to loc and scale when the signature specifies p, but as I said, check that first.
np.source(stats.distributions.logser_gen)
class logser_gen(rv_discrete): def _rvs(self, pr): return mtrand.logseries(pr,size=self._size) def _argcheck(self, pr): return (pr > 0) & (pr < 1) def _pmf(self, k, pr): return -pr**k * 1.0 / k / log(1-pr)
p is a probability between in (0,1), just a mistake in the documentation.
There is no numpy-dev list right? Should this list be used or the scipy-dev list>
That's a good Q: this is definitely a "bug" in the doc (loc and scale shouldn't be documented as such when they're not explicitly in the function signature), in which case scipy-dev is the proper place to post, but if it turns out to be a bug in the code also, then this is the proper place, since all numpy devs are subscribed here, and numpy users should know about potential bugs (numpy devs will correct me if I'm wrong).
I think question about the substance/content of the docstrings should always go to the mailing list of the corresponding function.
Josef
DG
Vincent _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Mathematician: noun, someone who disavows certainty when their uncertainty set is non-empty, even if that set has measure zero.
Hope: noun, that delusive spirit which escaped Pandora's jar and, with her lies, prevents mankind from committing a general suicide. (As interpreted by Robert Graves)
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Sat, Jun 26, 2010 at 3:18 PM,
On Sat, Jun 26, 2010 at 5:12 PM, Vincent Davis
wrote: On Sat, Jun 26, 2010 at 3:04 PM,
wrote: On Sat, Jun 26, 2010 at 4:58 PM, David Goldsmith
wrote: On Sat, Jun 26, 2010 at 1:41 PM, Vincent Davis
wrote: numpy.random.logseries(p, size=None)
but the parameters section, Parameters: loc : float scale : float > 0. size : {tuple, int} Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn.
Thanks, I'll file a ticket
Don't file a ticket, just edit the docs. It's just the docstring not the source
Ok, I just need to remember to make the changes :-) Vincent
the Return is also wrong
samples : {ndarray, scalar} where the values are all integers in [0, n].
sample values are greater or equal to one, but unbound above
stats.logser.pmf(np.arange(10000, 10005),0.99999) array([ 7.85931402e-06, 7.85844959e-06, 7.85758532e-06, 7.85672123e-06, 7.85585731e-06])
Josef
Vincent
Notice that p <> loc and what about scale.
I'll file a ticket unless I am mission something, Which should it be loc or p What about scale.
The source is opaque (to me; Cython?) so unless you can decipher it, test actual behavior and document that - my guess is that p is short for "parameters" and is intended to be a two-element array_like containing both the loc and scale parameters, but that's the way it should be documented, not with some unprecedented reference to loc and scale when the signature specifies p, but as I said, check that first.
np.source(stats.distributions.logser_gen)
class logser_gen(rv_discrete): def _rvs(self, pr): return mtrand.logseries(pr,size=self._size) def _argcheck(self, pr): return (pr > 0) & (pr < 1) def _pmf(self, k, pr): return -pr**k * 1.0 / k / log(1-pr)
p is a probability between in (0,1), just a mistake in the documentation.
There is no numpy-dev list right? Should this list be used or the scipy-dev list>
That's a good Q: this is definitely a "bug" in the doc (loc and scale shouldn't be documented as such when they're not explicitly in the function signature), in which case scipy-dev is the proper place to post, but if it turns out to be a bug in the code also, then this is the proper place, since all numpy devs are subscribed here, and numpy users should know about potential bugs (numpy devs will correct me if I'm wrong).
I think question about the substance/content of the docstrings should always go to the mailing list of the corresponding function.
Josef
DG
Vincent _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Mathematician: noun, someone who disavows certainty when their uncertainty set is non-empty, even if that set has measure zero.
Hope: noun, that delusive spirit which escaped Pandora's jar and, with her lies, prevents mankind from committing a general suicide. (As interpreted by Robert Graves)
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (3)
-
David Goldsmith
-
josef.pktd@gmail.com
-
Vincent Davis