Series选择和过滤
作者:互联网
格式:series[(判断条件1)&(判断条件2)|(判断条件3)]
只要返回值是bool型就可用做筛选:series[bool]
课上练习:
求筛选以'张'开头的序列
s=Series(["张3","张4","王5","赵6"],index=['a','b','c','d'])
In:s.str.startswith("张")
Out:
a 张3 b 张4 dtype: object
#startswith中间有个s,startswith中间有个s,startswith中间有个s
标签:startswith,Series,有个,选择,中间,过滤,bool,series 来源: https://www.cnblogs.com/xuwinwin/p/15755185.html