cudf.core.column.string.StringMethods.capitalize#

StringMethods.capitalize() SeriesOrIndex[source]#

将Series/Index中的字符串转换为大写。 目前这仅适用于ASCII字符。

Returns:
Series or Index of object

示例

>>> import cudf
>>> data = ['lower', 'CAPITALS', 'this is a sentence', 'SwApCaSe']
>>> s = cudf.Series(data)
>>> s.str.capitalize()
0                 Lower
1              Capitals
2    This is a sentence
3              Swapcase
dtype: object
>>> s = cudf.Series(["hello, friend","goodbye, friend"])
>>> s.str.capitalize()
0      Hello, friend
1    Goodbye, friend
dtype: object