Вот мой код, я хочу получить результат, содержащий b и c, но он выдаёт мне ошибку.
df = pd.read_excel('C:Test 0926.xlsx')
df.drop_duplicates(['mention'],inplace=True)
a = df['mention'].str.lower()
searchfor =[some words in it]
b = a[a.str.contains('|'.join(searchfor))]
opposite = [some words in it]
c = a[a.str.contains('|' .join(opposite))]
def check_it(sentences):
if b and c in sentences:
return sentences
d = a.apply(lambda x:check_it(x))
print(d)
Кто-нибудь может помочь с этим?