【发布时间】:2024-01-22 11:47:01
【问题描述】:
我有一个熊猫系列,我正在以这种方式应用字符串搜索
df['column_name'].str.contains('test1')
这给了我真/假列表,具体取决于字符串“test1”是否包含在“column_name”列中。
但是我无法测试两个字符串,我需要检查两个字符串是否都存在。类似的东西
df['column_name'].str.contains('test1' and 'test2')
这似乎不起作用。任何建议都会很棒。
【问题讨论】:
标签: python string pandas series