diff options
author | gfyoung <gfyoung@mit.edu> | 2016-01-18 20:29:34 +0000 |
---|---|---|
committer | gfyoung <gfyoung@mit.edu> | 2016-01-24 03:20:20 +0000 |
commit | 61f872265b67b313058a07533eaed88f4170ff2c (patch) | |
tree | 176f5c2f8fd052e0dc5853427390feb43dbe91e4 /numpy/polynomial/polyutils.py | |
parent | 9849922aa4ace91906878df51053a32e2719a722 (diff) | |
download | numpy-61f872265b67b313058a07533eaed88f4170ff2c.tar.gz |
BUG: One element array inputs get one element arrays returned in np.random
Fixes bug in np.random methods that would return scalars
when passed one-element array inputs. This is because
one-element ndarrays can be cast to integers / floats, which
is what functions like PyFloat_AsDouble do before converting
to the intended data type.
This commit changes the check used to determine whether the
inputs are purely scalar by converting all inputs to arrays
and checking if the resulting shape is an empty tuple (scalar)
or not (array).
Closes gh-4263.
Diffstat (limited to 'numpy/polynomial/polyutils.py')
0 files changed, 0 insertions, 0 deletions