hipdf.core.column.string.StringMethods.swapcase#
21 min read time
Applies to Linux
- StringMethods.swapcase() SeriesOrIndex #
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#
- lower
Converts all characters to lowercase.
- upper
Converts all characters to uppercase.
- title
Converts first character of each word to uppercase and remaining to lowercase.
- capitalize
Converts 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