cudf.core.accessors.string.StringMethods.endswith#

StringMethods.endswith(pat: str | tuple[str, ...]) Series | Index[source]#

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

Parameters:
patstr or tuple[str, …]

String pattern or tuple of patterns. 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.

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

Pandas Compatibility Note

pandas.Series.str.endswith()

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