summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorJonas Liechti <jonas.liechti@uzh.ch>2021-10-01 18:43:50 +0200
committerJonas Liechti <jonas.liechti@uzh.ch>2021-10-01 18:43:50 +0200
commit6000e438ea56e7eb622fe99ce28321eb81faec59 (patch)
treec923ad90ab4c314579feb64832fdeb68762c7662 /numpy/lib/function_base.py
parentc7832859666971f4509847ddb2db0a0470c77e95 (diff)
downloadnumpy-6000e438ea56e7eb622fe99ce28321eb81faec59.tar.gz
use an example that also shows default value
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 80eaf8acf..0dee7784a 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -657,11 +657,11 @@ def select(condlist, choicelist, default=0):
Examples
--------
- >>> x = np.arange(10)
- >>> condlist = [x<3, x>5]
+ >>> x = np.arange(6)
+ >>> condlist = [x<3, x>3]
>>> choicelist = [x, x**2]
>>> np.select(condlist, choicelist)
- array([ 0, 1, 2, ..., 49, 64, 81])
+ array([ 0, 1, 2, 0, 16, 25])
"""
# Check the size of condlist and choicelist are the same, or abort.