From 91d1c1ebd26d3269c45051d61bf24efb8db0678e Mon Sep 17 00:00:00 2001 From: Sarah Coffland Date: Mon, 19 Sep 2022 06:31:13 -0700 Subject: DOC: Add `isupper` examples (#22285) * added examples for isupper * fixed examples for isupper * Update numpy/core/defchararray.py Co-authored-by: Rohit Goswami * Update numpy/core/defchararray.py Co-authored-by: Rohit Goswami * Update numpy/core/defchararray.py Co-authored-by: Rohit Goswami * Update numpy/core/defchararray.py Co-authored-by: Ross Barnowski Co-authored-by: Rohit Goswami Co-authored-by: Sebastian Berg Co-authored-by: Ross Barnowski Co-authored-by: Charles Harris --- numpy/core/defchararray.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'numpy/core/defchararray.py') diff --git a/numpy/core/defchararray.py b/numpy/core/defchararray.py index fe6694087..0da1a5639 100644 --- a/numpy/core/defchararray.py +++ b/numpy/core/defchararray.py @@ -951,7 +951,7 @@ def istitle(a): @array_function_dispatch(_unary_op_dispatcher) def isupper(a): """ - Returns true for each element if all cased characters in the + Return true for each element if all cased characters in the string are uppercase and there is at least one character, false otherwise. @@ -976,7 +976,10 @@ def isupper(a): -------- >>> str = "GHC" >>> np.char.isupper(str) - array(True) + array(True) + >>> a = np.array(["hello", "HELLO", "Hello"]) + >>> np.char.isupper(a) + array([False, True, False]) """ return _vec_string(a, bool_, 'isupper') -- cgit v1.2.1