Python Practice › Pandas Programs › Program 72

Lowercase-only check

EasyPandas Programs · 72 of 95

Write a pandas program to check which values are fully lowercase.

Advertisement
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

  1. str.islower().

Solution

Python
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
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More pandas programs

← All 95 Pandas Programs