NumPy: isupper() function
numpy.core.defchararray.isupper() function
The numpy.core.defchararray.isupper() function returns true for each element if all cased characters in the string are uppercase and there is at least one character, false otherwise.
Version: 1.15.0
Syntax:
numpy.core.defchararray.isupper(a)
Parameter:
Name | Description | Required / Optional |
---|---|---|
a: array_like of str or unicode | Input an array_like of string or unicode | Required |
Return value:
out : ndarray - Output array of bools
Note:
The 'chararray' class exists for backwards compatibility with Numarray, it is not recommended for new development. Starting from numpy 1.4, if one needs arrays of strings, it is recommended to use arrays of 'dtype' 'object_', 'string_' or 'unicode_', and use the free functions in the 'numpy.char' module for fast vectorized string operations.
Some methods will only be available if the corresponding string method is available in your version of Python.
The preferred alias for 'defchararray' is 'numpy.char'.
Example-1: numpy.isupper() function
>>> import numpy as np
>>> x = np.char.isupper('the quick brown fox')
>>> x
array(False)
Pictorial Presentation:
Example-2: numpy.isupper() function
>>> import numpy as np
>>> y = np.char.isupper('THE QUICK BROWN FOX')
>>> y
array(True)
Pictorial Presentation:
Example-3: numpy.isupper() function
>>> import numpy as np
>>> z = np.char.isupper('THE quick brown fox')
>>> z
array(False)
Pictorial Presentation:
Python - NumPy Code Editor:
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework