diff options
author | Jonathan Helmus <jjhelmus@gmail.com> | 2015-10-20 20:35:43 -0500 |
---|---|---|
committer | Jonathan Helmus <jjhelmus@gmail.com> | 2015-10-20 20:35:43 -0500 |
commit | 3edf1a43987be276459e01c4afa7bbc6c74e7144 (patch) | |
tree | f2a4d8c29c6d4b86a416fab819b11348ef16048f /numpy/ma/extras.py | |
parent | 4750c2810c5e0943cbea8e2acc0337c4e66a9bb2 (diff) | |
download | numpy-3edf1a43987be276459e01c4afa7bbc6c74e7144.tar.gz |
BUG: scalar argument to ma.atleast_* return arrays
The np.ma.atleast_1d, np.ma.atleast_2d, np.ma.atleast_3d and np.ma.diagflat
function return arrays when given a scalar in the same manner as their non-ma
counterparts. Previously these function would return None.
Additionally, the np.ma vstack, row_stack, hstack, column_stack, dstack, and
hsplit functions now raise an expection when given a scalar argument.
closes #3367
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r-- | numpy/ma/extras.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py index b4021df63..ae4e0cee5 100644 --- a/numpy/ma/extras.py +++ b/numpy/ma/extras.py @@ -270,6 +270,10 @@ class _fromnxfunction: _d = func(tuple([np.asarray(a) for a in x]), **params) _m = func(tuple([getmaskarray(a) for a in x]), **params) return masked_array(_d, mask=_m) + else: + _d = func(np.asarray(x), **params) + _m = func(getmaskarray(x), **params) + return masked_array(_d, mask=_m) else: arrays = [] args = list(args) |