[Numpy-discussion] multivariate_normal issue with 'size' argument

Charles R Harris charlesr.harris at gmail.com
Sun May 26 13:51:54 EDT 2013


On Fri, May 24, 2013 at 1:09 PM, Christoph Gohlke <cgohlke at uci.edu> wrote:
<snip>


> This patch works for me:
>
> diff --git a/numpy/random/mtrand/mtrand.pyx
> b/numpy/random/mtrand/mtrand.pyx
> index b0de560..233ff52 100644
> --- a/numpy/random/mtrand/mtrand.pyx
> +++ b/numpy/random/mtrand/mtrand.pyx
> @@ -4156,7 +4156,7 @@ cdef class RandomState:
>           if mean.shape[0] != cov.shape[0]:
>                  raise ValueError("mean and cov must have same length")
>           # Compute shape of output
> -        if isinstance(shape, int):
> +        if isinstance(shape, (int, long, np.integer)):
>               shape = [shape]
>           final_shape = list(shape[:])
>           final_shape.append(mean.shape[0])
>
>
Looks right. Can you make a PR for this, maybe with a test that might
otherwise fail for some architectures?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130526/47da7a0c/attachment.html>


More information about the NumPy-Discussion mailing list