Python Practice › Pandas Programs › Program 72
Lowercase-only check
Write a pandas program to check which values are fully lowercase.
Input
["kate", "jason", "ROBERT", "MARK", "dwyane"]
Output
Name is_lower 0 kate True 1 jason True 2 ROBERT False 3 MARK False 4 dwyane True
Approach
str.islower().
Solution
import pandas as pddf = pd.DataFrame({"Name": ["kate", "jason", "ROBERT", "MARK", "dwyane"]})df["is_lower"] = df["Name"].str.islower()print(df)Output
Name is_lower 0 kate True 1 jason True 2 ROBERT False 3 MARK False 4 dwyane True
Learn the concept
New to this topic? Read the lesson, then come back.