Skip to content

LazyColumn.str.endswith

endswith

endswith(suffix: str) -> LazyColumn

Checks whether each string ends with a given suffix.

Parameters:

Name Type Description Default
suffix str

The suffix to check for.

required

Returns:

Name Type Description
LazyColumn LazyColumn

A new LazyColumn of boolean values indicating whether each string ends with suffix. Null entries remain null (or False depending on implementation).

Examples:

print(df.head())
#    col1 my_string_column
# 0     1          "Hello"
# 1     2          "HiWorld"
# 2     3          None
# 3     4          "Testing"
# 4     5          "Example"

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