mars.dataframe.Series.str.lower#
- Series.str.lower()#
Convert strings in the Series/Index to lowercase.
Equivalent to
str.lower().参见
Series.str.lowerConverts all characters to lowercase.
Series.str.upperConverts all characters to uppercase.
Series.str.titleConverts first character of each word to uppercase and remaining to lowercase.
Series.str.capitalizeConverts first character to uppercase and remaining to lowercase.
Series.str.swapcaseConverts uppercase to lowercase and lowercase to uppercase.
Series.str.casefoldRemoves all case distinctions in the string.
示例
>>> import mars.dataframe as md >>> s = md.Series(['lower', 'CAPITALS', 'this is a sentence', 'SwApCaSe']) >>> s.execute() 0 lower 1 CAPITALS 2 this is a sentence 3 SwApCaSe dtype: object
>>> s.str.lower().execute() 0 lower 1 capitals 2 this is a sentence 3 swapcase dtype: object
>>> s.str.upper().execute() 0 LOWER 1 CAPITALS 2 THIS IS A SENTENCE 3 SWAPCASE dtype: object
>>> s.str.title().execute() 0 Lower 1 Capitals 2 This Is A Sentence 3 Swapcase dtype: object
>>> s.str.capitalize().execute() 0 Lower 1 Capitals 2 This is a sentence 3 Swapcase dtype: object
>>> s.str.swapcase().execute() 0 LOWER 1 capitals 2 THIS IS A SENTENCE 3 sWaPcAsE dtype: object