I am trying to filter all rows containing two words: mom
and dad
.
Family
My mom is a teacher.
My dad is a policeman.
Both my mom and dad are retired.
My expected output would be
Both my mom and dad are retired
as it contains both the words. I have tried with str.contains(). Just wondering if there is another approach to do it.
s = df.Family
searchfor = ['mom', 'dad']
found = [s.str.contains(x) for x in searchfor]
result = pd.DataFrame[found]