cudf.core.accessors.string.StringMethods.is_consonant#
- StringMethods.is_consonant(position) Series | Index[source]#
Return true for strings where the character at
positionis a consonant. Thepositionparameter may also be a list of integers to check different characters per string. If thepositionis 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