用法:
StringMethods.swapcase() → SeriesOrIndex
將每個小寫字符更改為大寫,反之亦然。這僅適用於此時的 ASCII 字符。
等效於 str.swapcase() 。
- 對象的係列或索引
返回:
例子:
>>> import cudf >>> data = ['lower', 'CAPITALS', 'this is a sentence', 'SwApCaSe'] >>> s = cudf.Series(data) >>> s 0 lower 1 CAPITALS 2 this is a sentence 3 SwApCaSe dtype: object >>> s.str.swapcase() 0 LOWER 1 capitals 2 THIS IS A SENTENCE 3 sWaPcAsE dtype: object
相關用法
- 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.slice_replace用法及代碼示例
- Python cudf.core.column.string.StringMethods.startswith用法及代碼示例
- Python cudf.core.column.string.StringMethods.strip用法及代碼示例
- 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.swapcase。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。