Pandas Series str function islower() in Python
The Pandas Series str function islower() used to determine whether all characters in each elements are lowercase. An empty string considered as False. It returns Series or Index that includes boolean value element-wise.
Syntax
 1 Series.str.islower()
islower() function
 1 import pandas as pd
 2 import numpy as np
 3 
 4 ser = pd.Series(['Python', 'hello', np.nan, '', 'JAVA'])
 5                 
 6 print('The original Series object :')
 7 print(ser)
 8 
 9 res = ser.str.islower()
 10 print('The whether elements are lowercase :')
 11 print(res)
In the above example, a Series object is created by passing an array of string. A islower() function is called that determine whether all characters are lowercase. The result is assigned to variable that will be printed on console.
Output
 1 The original Series object :
 2 0    Python
 3 1     hello
 4 2       NaN
 5 3
 6 4      JAVA
 7 dtype: object
 8 The whether elements are lowercase :
 9 0    False
 10 1     True
 11 2      NaN
 12 3    False
 13 4    False
 14 dtype: object

Example 2

Example 2
 1 import pandas as pd
 2 
 3 ser = pd.Series(['   ', 'welcome', 'IOGyan', ''])
 4                 
 5 print('The original Series object :')
 6 print(ser)
 7 
 8 res = ser.str.islower()
 9 print('The whether elements are lowercase :')
 10 print(res)
In the above example, a Series object is created by passing an array of string, empty and white spaces string. A islower() function is called that determine whether all characters are lowercase. The result is assigned to variable that will be print.
Output
 1 The original Series object :
 2 0           
 3 1    welcome
 4 2     IOGyan
 5 3           
 6 dtype: object
 7 The whether elements are lowercase :
 8 0    False
 9 1     True
 10 2    False
 11 3    False
 12 dtype: bool
Privacy Policy
Terms of Service
Disclaimer
Contact us
About us