cudf.core.column.string.StringMethods.title#
- StringMethods.title() SeriesOrIndex[source]#
将空格后的每个字母的首字母大写,其余字母小写。目前这仅适用于ASCII字符。
相当于 str.title().
- Returns:
- Series or Index of object
另请参阅
lower将所有字符转换为小写。
upper将所有字符转换为大写。
capitalize将第一个字符转换为大写,其余字符转换为小写。
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.title() 0 Lower 1 Capitals 2 This Is A Sentence 3 Swapcase dtype: object