用法:
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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。