我有一个包含三行数据的df(Pandas数据框):
some_col_name
"apple is delicious"
"banana is delicious"
"apple and banana both are delicious"
df.col_name.str.contains("apple|banana")
函数将捕获所有行:
"apple is delicious",
"banana is delicious",
"apple and banana both are delicious".
如何在str.contains()
方法中使用AND运算符,以便仅获取同时包含“apple”和“banana”的字符串?
"apple and banana both are delicious"
我想获取包含10-20个不同单词(葡萄,西瓜,浆果,橙子,...等)的字符串。