polars.Series.cat.ends_with#

Series.cat.ends_with(suffix: str) Series[source]#

Check if string representations of values end with a substring.

Parameters:
suffix

Suffix substring.

See also

contains

Check if the string repr contains a substring that matches a pattern.

starts_with

Check if string repr starts with a substring.

Examples

>>> s = pl.Series("fruits", ["apple", "mango", None], dtype=pl.Categorical)
>>> s.cat.ends_with("go")
shape: (3,)
Series: 'fruits' [bool]
[
    false
    true
    null
]