maxframe.dataframe.Series.str.lower#
- Series.str.lower()#
将 Series/Index 中的字符串转换为小写。
等效于
str.lower()。- 返回:
A Series or Index where the strings are modified by
str.lower().- 返回类型:
参见
Series.str.lower将所有字符转换为小写。
Series.str.upper将所有字符转换为大写。
Series.str.title将每个单词的第一个字符转换为大写,其余字符转换为小写。
Series.str.capitalize将第一个字符转换为大写,其余字符转换为小写。
Series.str.swapcase将大写转换为小写,小写转换为大写。
Series.str.casefold移除字符串中的所有大小写区分。
示例
>>> import maxframe.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: str
>>> s.str.lower().execute() 0 lower 1 capitals 2 this is a sentence 3 swapcase dtype: str
>>> s.str.upper().execute() 0 LOWER 1 CAPITALS 2 THIS IS A SENTENCE 3 SWAPCASE dtype: str
>>> s.str.title().execute() 0 Lower 1 Capitals 2 This Is A Sentence 3 Swapcase dtype: str
>>> s.str.capitalize().execute() 0 Lower 1 Capitals 2 This is a sentence 3 Swapcase dtype: str
>>> s.str.swapcase().execute() 0 LOWER 1 capitals 2 THIS IS A SENTENCE 3 sWaPcAsE dtype: str