df(Pandas Dataframe)有三行.
some_col_name
"apple is delicious"
"banana is delicious"
"apple and banana both are delicious"
Run Code Online (Sandbox Code Playgroud)
df.col_name.str.contains("apple|banana")
将捕获所有行:
"apple is delicious",
"banana is delicious",
"apple and banana both are delicious".
Run Code Online (Sandbox Code Playgroud)
如何在str.contains方法上应用AND运算符,以便它只捕获包含苹果和香蕉的字符串?
"apple and banana both are delicious"
Run Code Online (Sandbox Code Playgroud)
我想抓住包含10-20个不同单词的字符串(葡萄,西瓜,浆果,橙子,......等)