Skip to content

LazyColumn.str.isnumeric

isnumeric

isnumeric() -> LazyColumn

Checks if all characters in each string are numeric.

This is similar to isdigit() but includes other number-like Unicode characters. For simplicity in this implementation, we're making it equivalent to isdigit().

Returns:

Name Type Description
LazyColumn LazyColumn

A new LazyColumn of boolean values indicating whether each string contains only numeric characters.

Examples:

print(df.head())
#    col1 my_string_column
# 0     1         "123"
# 1     2         "Test123"
# 2     3         "456"
# 3     4         ""
# 4     5         None

df["my_string_column"].str.isnumeric()
# [True, False, True, False, None]