numpy/numpy — pull request #3373 by cgohlke (2013-05-27 19:32:06+00:00)
Title: multivariate_normal issue with 'size' argument

From http://mail.scipy.org/pipermail/numpy-discussion/2013-May/066683.html

```
[Numpy-discussion] multivariate_normal issue with 'size' argument
Emanuele Olivetti emanuele@relativita....
Fri May 24 07:02:22 CDT 2013

Hi,

I'm using NumPy v1.6.1 shipped with Ubuntu 12.04 (Python 2.7.3). I observed an
odd behavior of the multivariate_normal function, which does not like int64 for
the 'size' argument.
Short example:
"""
import numpy as np
print np.random.multivariate_normal(mean=np.zeros(2), cov=np.eye(2), size=1)
print np.random.multivariate_normal(mean=np.zeros(2), cov=np.eye(2),
size=np.int64(1))
"""

Which outputs:

"""
$ python2.7 mvn_bug.py
[[ 0.28880655 0.43289446]]
Traceback (most recent call last):
File "mvn_bug.py", line 3, in
print np.random.multivariate_normal(mean=np.zeros(2), cov=np.eye(2),
size=np.int64(1))
File "mtrand.pyx", line 3990, in mtrand.RandomState.multivariate_normal
(numpy/random/mtrand/mtrand.c:16663)
IndexError: invalid index to scalar variable.
"""

I had a brief look to the tracker but haven't found any mention of this issue.
It might be already solved in the current NumPy (v1.7.0)... or not.

I'd like to have your feedback before submitting this issue to the bug tracking
system.

Best,

Emanuele
```