Pandas 文本数据方法 replace( )
2017-05-08 00:00
113 查看
Series.str.replace(pat, repl, n=-1, case=True, flags=0)替换指定字符
参数:
pat : 字符串,要替换的值可以是正则表达式
repl : 字符串,替换值
n : 整型, 要替换几处(默认-1,表示所有都要替换)
case : 布尔值, 如果为True则是严格替换
flags : 整型, 如果为0则没有flags
返回值:
序列Series/索引Index
参数:
pat : 字符串,要替换的值可以是正则表达式
repl : 字符串,替换值
n : 整型, 要替换几处(默认-1,表示所有都要替换)
case : 布尔值, 如果为True则是严格替换
flags : 整型, 如果为0则没有flags
返回值:
序列Series/索引Index
相关文章推荐
- Pandas 文本数据方法 replace( )
- Pandas 文本数据方法 extract( ) extractall( )
- Pandas 文本数据方法 wrap( )
- Pandas 文本数据方法 get_dummies()
- Pandas 文本数据方法 find( ) rfind( ) index( ) rindex( )
- Pandas 文本数据方法 startswith( ) endwith( )
- Pandas 文本数据方法 contains()
- Pandas 文本数据方法 split()rsplit()
- Pandas 文本数据方法 extract( ) extractall( )
- Pandas 文本数据方法 is*()
- Pandas 文本数据方法 wrap( )
- Pandas 文本数据方法 repeat( )
- Pandas 文本数据方法 partition( )
- Pandas 文本数据方法 count( )
- Pandas 文本数据方法 cat()
- Pandas 文本数据方法 strip( ) lstrip( ) rstrip( )
- Pandas 文本数据方法 pad( ) center( ) ljust() rjust() zfill()
- Pandas 文本数据方法 join( )
- Pandas 文本数据方法 slice( )
- Pandas 文本数据方法 split()rsplit()