Pandas 文本数据方法 count( )
2017-05-08 00:00
246 查看
Series.str.count(pat, flags=0, **kwargs)查看字符在各个元素中出现的次数
参数:
pat : 字符串或正则
flags : 整型
Returns:
序列Series/索引Index
参数:
pat : 字符串或正则
flags : 整型
Returns:
序列Series/索引Index
import pandas as pd s = pd.Series(['A', 'B', 'C', 'Aaba', 'Baca', 'CABA', 'dog', 'cat']) print(s.str.count("A")) 0 1 1 0 2 0 3 1 4 0 5 2 6 0 7 0 dtype: int64
相关文章推荐
- Pandas 文本数据方法 count( )
- Pandas 文本数据方法 extract( ) extractall( )
- Pandas 文本数据方法 wrap( )
- Pandas 文本数据方法 extract( ) extractall( )
- Pandas 文本数据方法 find( ) rfind( ) index( ) rindex( )
- Pandas 文本数据方法 split()rsplit()
- Pandas 文本数据方法 contains()
- Pandas 文本数据方法 split()rsplit()
- Pandas 文本数据方法 cat()
- Pandas 文本数据方法 is*()
- Pandas 文本数据方法 get( )
- Pandas 文本数据方法 repeat( )
- Pandas 文本数据方法 partition( )
- Pandas 文本数据方法 slice( )
- Pandas 文本数据方法 strip( ) lstrip( ) rstrip( )
- Pandas 文本数据方法 pad( ) center( ) ljust() rjust() zfill()
- Pandas 文本数据方法 join( )
- Pandas 文本数据方法 slice( )
- Pandas 文本数据方法 contains()
- Pandas 文本数据方法 startswith( ) endwith( )