cudf.core.column.string.StringMethods.endswith#

StringMethods.endswith(pat: str) SeriesOrIndex#

Test if the end of each string element matches a pattern.

Parameters:
patstr or list-like

If str is an str, evaluates whether each string of series ends with pat. If pat is a list-like, evaluates whether self[i] ends with pat[i]. Regular expressions are not accepted.

Returns:
Series or Index of bool

A Series of booleans indicating whether the given pattern matches the end of each string element.

Notes

na parameter is not yet supported, as cudf uses native strings instead of Python objects.

Examples

>>> import cudf
>>> s = cudf.Series(['bat', 'bear', 'caT', None])
>>> s
0     bat
1    bear
2     caT
3    <NA>
dtype: object
>>> s.str.endswith('t')
0     True
1    False
2    False
3     <NA>
dtype: bool