summaryrefslogtreecommitdiff
path: root/numpy/core/multiarray.py
diff options
context:
space:
mode:
authorStephan Hoyer <shoyer@google.com>2018-10-14 16:27:31 -0700
committerStephan Hoyer <shoyer@google.com>2018-10-14 16:27:31 -0700
commit0d1330a04ffd3da7fee4355406fe128d4e4368c9 (patch)
tree55538baebd38c7aad1a607fc30c5ba61c01653db /numpy/core/multiarray.py
parent56cd90fdae97e7447c3b0a076dc5647c43e1748f (diff)
downloadnumpy-0d1330a04ffd3da7fee4355406fe128d4e4368c9.tar.gz
MAINT: fixup where signature
Diffstat (limited to 'numpy/core/multiarray.py')
-rw-r--r--numpy/core/multiarray.py7
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)