cudf.core.column.string.StringMethods.is_consonant#

StringMethods.is_consonant(position) SeriesOrIndex#

Return true for strings where the character at position is a consonant. The position parameter may also be a list of integers to check different characters per string. If the position is larger than the string length, False is returned for that string.

Parameters
position: int or list-like

The character position to check within each string.

Returns
Series or Index of bool dtype.

Examples

>>> import cudf
>>> ser = cudf.Series(["toy", "trouble"])
>>> ser.str.is_consonant(1)
0    False
1     True
dtype: bool
>>> positions = cudf.Series([2, 3])
>>> ser.str.is_consonant(positions)
0     True
1    False
dtype: bool