https://blog.youkuaiyun.com/weixin_43615654/article/details/103419171
这篇里用到了一个Str的contains函数,查了一下用法。
Returns: Series or Index of boolean values
A Series or Index of boolean values indicating whether the given pattern is contained within the string of each element of the Series or Index.
中文资料:
pandas(3)筛选数据isin(), str.contains()
demo:
s1 = pd.Series(['Mouse', 'dog', 'house and parrot', '23', np.NaN])
print(s1.str.contains('og',regex=False))
0 False
1 True
2 False
3 False
4 NaN
dtype: object