用法:
StringMethods.startswith(pat: Union[str, Sequence]) → SeriesOrIndex
測試每個字符串元素的開頭是否與模式匹配。
等效於 str.startswith() 。
- pat:str 或 list-like
如果
str
是str
,則評估每個係列字符串是否以pat
開頭。如果pat
是 list-like,則評估self[i]
是否以pat[i]
開頭。不接受正則表達式。
- 布爾係列或索引
一係列布爾值,指示給定模式是否與每個字符串元素的開頭匹配。
參數:
返回:
例子:
>>> import cudf >>> s = cudf.Series(['bat', 'Bear', 'cat', None]) >>> s 0 bat 1 Bear 2 cat 3 <NA> dtype: object >>> s.str.startswith('b') 0 True 1 False 2 False 3 <NA> dtype: bool
相關用法
- Python cudf.core.column.string.StringMethods.strip用法及代碼示例
- Python cudf.core.column.string.StringMethods.split用法及代碼示例
- Python cudf.core.column.string.StringMethods.slice用法及代碼示例
- Python cudf.core.column.string.StringMethods.slice_from用法及代碼示例
- Python cudf.core.column.string.StringMethods.swapcase用法及代碼示例
- Python cudf.core.column.string.StringMethods.slice_replace用法及代碼示例
- Python cudf.core.column.string.StringMethods.is_vowel用法及代碼示例
- Python cudf.core.column.string.StringMethods.endswith用法及代碼示例
- Python cudf.core.column.string.StringMethods.title用法及代碼示例
- Python cudf.core.column.string.StringMethods.contains用法及代碼示例
- Python cudf.core.column.string.StringMethods.rsplit用法及代碼示例
- Python cudf.core.column.string.StringMethods.zfill用法及代碼示例
- Python cudf.core.column.string.StringMethods.hex_to_int用法及代碼示例
- Python cudf.core.column.string.StringMethods.htoi用法及代碼示例
- Python cudf.core.column.string.StringMethods.character_tokenize用法及代碼示例
- Python cudf.core.column.string.StringMethods.normalize_characters用法及代碼示例
- Python cudf.core.column.string.StringMethods.filter_alphanum用法及代碼示例
- Python cudf.core.column.string.StringMethods.ngrams用法及代碼示例
- Python cudf.core.column.string.StringMethods.replace_with_backrefs用法及代碼示例
- Python cudf.core.column.string.StringMethods.insert用法及代碼示例
注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cudf.core.column.string.StringMethods.startswith。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。