例如:
pd.Series('ASKING CD.').str.contains('AS')
Out[58]:
0 True
dtype: bool
pd.Series('ASKING CD.').str.contains('ASG')
Out[59]:
0 False
dtype: bool
pd.Series('ASKING CD.').str.contains('SK.')
Out[60]:
0 True
dtype: bool
为什么第三个输出是真的?传递的字符串中没有“SK.”序列。'dot'字符不代表什么?在
Tags:
Regex
.
表示匹配任何字符。解决方案是转义.
或添加参数regex=False
:相关问题 更多 >
编程相关推荐