cudf.core.accessors.string.StringMethods.swapcase#
- StringMethods.swapcase() Series | Index[source]#
Change each lowercase character to uppercase and vice versa. This only applies to ASCII characters at this time.
Equivalent to str.swapcase().
- Returns:
- Series or Index of object
See also
lowerConverts all characters to lowercase.
upperConverts all characters to uppercase.
titleConverts first character of each word to uppercase and remaining to lowercase.
capitalizeConverts first character to uppercase and remaining to lowercase.
Examples
>>> 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