Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

function
numpy
python
pyt
communitycreator

What is the numpy.char.isupper() function in Python?

Onyejiaku Theophilus Chidalu

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Overview

The char.isupper() function in Python returns True for each element of an input array of string, if all cased characters in the string are uppercase and there is at least one character, and returns False if it is otherwise.

Syntax

char.isupper(a)
Syntax for the char.isupper() function

Parameter

The char.isupper() function takes a single parameter value, a, which represents the input array.

Return value

The char.isupper() function returns an output array of Boolean values of the same shape as the input array a.

Example

Let's look at the code below:

import numpy as np
# creating an input array
a = np.array(['UPPERCASE', "Uppercase", "UPPERcase", "uppercase",])
# implementing the char.isupper() function
myarray = np.char.isupper(a)
# printing the input array
print(a)
# printing the output arrays
print(myarray)
Implementing the char.isuppper() function

RELATED TAGS

function
numpy
python
pyt
communitycreator

CONTRIBUTOR

Onyejiaku Theophilus Chidalu

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring