diff options
author | Stephan Hoyer <shoyer@google.com> | 2018-10-14 16:27:31 -0700 |
---|---|---|
committer | Stephan Hoyer <shoyer@google.com> | 2018-10-14 16:27:31 -0700 |
commit | 0d1330a04ffd3da7fee4355406fe128d4e4368c9 (patch) | |
tree | 55538baebd38c7aad1a607fc30c5ba61c01653db /numpy/core/multiarray.py | |
parent | 56cd90fdae97e7447c3b0a076dc5647c43e1748f (diff) | |
download | numpy-0d1330a04ffd3da7fee4355406fe128d4e4368c9.tar.gz |
MAINT: fixup where signature
Diffstat (limited to 'numpy/core/multiarray.py')
-rw-r--r-- | numpy/core/multiarray.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/core/multiarray.py b/numpy/core/multiarray.py index aafda476f..34a37f40c 100644 --- a/numpy/core/multiarray.py +++ b/numpy/core/multiarray.py @@ -8,6 +8,7 @@ by importing from the extension module. from . import _multiarray_umath from .overrides import array_function_dispatch +import numpy as np from numpy.core._multiarray_umath import * from numpy.core._multiarray_umath import ( _fastCopyAndTranspose, _flagdict, _insert, _reconstruct, _vec_string, @@ -271,12 +272,12 @@ def inner(a, b): return _multiarray_umath.inner(a, b) -def _where_dispatcher(condition, x, y): +def _where_dispatcher(condition, x=np._NoValue, y=np._NoValue): return (condition, x, y) @array_function_dispatch(_where_dispatcher) -def where(condition, x, y): +def where(condition, x=np._NoValue, y=np._NoValue): """ where(condition, [x, y]) @@ -348,5 +349,5 @@ def where(condition, x, y): [ 0, 3, -1]]) """ # _multiarray_umath.where only accepts positional arguments - args = tuple(a for a in (x, y) if a is not None) + args = tuple(a for a in (x, y) if a is not np._NoValue) return _multiarray_umath.where(condition, *args) |