What is the numpy.char.islower() function from NumPy in Python?
Overview
The char.islower() function in Python returns True for each element of an input array of strings. This happens if all the cased characters in the string are lowercase and there is at least one cased character. Otherwise, the function returns False.
Syntax
char.islower(a)
Syntax for the char.islower() function
Parameter value
The char.islower() function takes a single parameter value, a, which represents the input array of strings.
Return value
The char.islower() function returns an output array of boolean values with the same shape as the input array a.
Example
import numpy as np# creating an input arraya = np.array(['HELLO', "hello", "HI", "hi", "A", "a"])# implementing the char.islower() functionmyarray = np.char.islower(a)# printing the input arrayprint(a)# printing the output arraysprint(myarray)
Explanation
numpymodule.a using the array() function.char.islower() function on the input array. The result is assigned to the myarray variable.a.myarrayoutput array.