cudf.core.column.string.StringMethods.is_vowel#
- StringMethods.is_vowel(position) SeriesOrIndex[source]#
如果字符串中
position位置的字符是元音而不是辅音,则返回true。position参数也可以是一个整数列表,用于检查每个字符串中的不同字符。如果position大于字符串长度,则对该字符串返回False。- Parameters:
- position: int or list-like
要检查每个字符串中的字符位置。
- Returns:
- Series or Index of bool dtype.
示例
>>> import cudf >>> ser = cudf.Series(["toy", "trouble"]) >>> ser.str.is_vowel(1) 0 True 1 False dtype: bool >>> positions = cudf.Series([2, 3]) >>> ser.str.is_vowel(positions) 0 False 1 True dtype: bool