用法:
Series.str()
系列和索引的矢量化字符串函数。
除非通过特定方法另有处理,否则 NA 将保持 NA。仿照 Python 的字符串方法,从 R 的 stringr 包中获得一些灵感。
例子:
>>> s = pd.Series(["A_Str_Series"]) >>> s 0 A_Str_Series dtype:object
>>> s.str.split("_") 0 [A, Str, Series] dtype:object
>>> s.str.replace("_", "") 0 AStrSeries dtype:object
相关用法
- Python pandas.Series.str.isdecimal用法及代码示例
- Python pandas.Series.str.get用法及代码示例
- Python pandas.Series.str.replace用法及代码示例
- Python pandas.Series.str.endswith用法及代码示例
- Python pandas.Series.str.isspace用法及代码示例
- Python pandas.Series.str.isdigit用法及代码示例
- Python pandas.Series.str.wrap用法及代码示例
- Python pandas.Series.str.isalnum用法及代码示例
- Python pandas.Series.str.zfill用法及代码示例
- Python pandas.Series.str.partition用法及代码示例
- Python pandas.Series.str.isnumeric用法及代码示例
- Python pandas.Series.str.startswith用法及代码示例
- Python pandas.Series.str.count用法及代码示例
- Python pandas.Series.str.rpartition用法及代码示例
- Python pandas.Series.str.strip用法及代码示例
- Python pandas.Series.str.removesuffix用法及代码示例
- Python pandas.Series.str.rsplit用法及代码示例
- Python pandas.Series.str.islower用法及代码示例
- Python pandas.Series.str.removeprefix用法及代码示例
- Python pandas.Series.str.len用法及代码示例
注:本文由纯净天空筛选整理自pandas.pydata.org大神的英文原创作品 pandas.Series.str。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。