diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2022-11-15 13:31:47 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 13:31:47 -0600 |
commit | 3ca02ce5b1a4ec2412cad839d42452a4200a5270 (patch) | |
tree | f1777b8defeb5c33bafadf89da770ab14358c0b3 /numpy/random/_generator.pyx | |
parent | 8cededdf4eeebd4f1985bd74c11fbf44f367937f (diff) | |
parent | e88592e94a0b7de726bc1e3dbf3abf637be47273 (diff) | |
download | numpy-3ca02ce5b1a4ec2412cad839d42452a4200a5270.tar.gz |
Merge pull request #22594 from charris/backport-22450
BUG: Fix boundschecking for `random.logseries`
Diffstat (limited to 'numpy/random/_generator.pyx')
-rw-r--r-- | numpy/random/_generator.pyx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/random/_generator.pyx b/numpy/random/_generator.pyx index 5218c6d0e..2c25b7191 100644 --- a/numpy/random/_generator.pyx +++ b/numpy/random/_generator.pyx @@ -25,7 +25,7 @@ from ._pcg64 import PCG64 from numpy.random cimport bitgen_t from ._common cimport (POISSON_LAM_MAX, CONS_POSITIVE, CONS_NONE, CONS_NON_NEGATIVE, CONS_BOUNDED_0_1, CONS_BOUNDED_GT_0_1, - CONS_GT_1, CONS_POSITIVE_NOT_NAN, CONS_POISSON, + CONS_BOUNDED_LT_0_1, CONS_GT_1, CONS_POSITIVE_NOT_NAN, CONS_POISSON, double_fill, cont, kahan_sum, cont_broadcast_3, float_fill, cont_f, check_array_constraint, check_constraint, disc, discrete_broadcast_iii, validate_output_shape @@ -3437,12 +3437,12 @@ cdef class Generator: Draw samples from a logarithmic series distribution. Samples are drawn from a log series distribution with specified - shape parameter, 0 < ``p`` < 1. + shape parameter, 0 <= ``p`` < 1. Parameters ---------- p : float or array_like of floats - Shape parameter for the distribution. Must be in the range (0, 1). + Shape parameter for the distribution. Must be in the range [0, 1). size : int or tuple of ints, optional Output shape. If the given shape is, e.g., ``(m, n, k)``, then ``m * n * k`` samples are drawn. If size is ``None`` (default), @@ -3506,7 +3506,7 @@ cdef class Generator: """ return disc(&random_logseries, &self._bitgen, size, self.lock, 1, 0, - p, 'p', CONS_BOUNDED_0_1, + p, 'p', CONS_BOUNDED_LT_0_1, 0.0, '', CONS_NONE, 0.0, '', CONS_NONE) |