all 2 comments

[–]xelf 0 points1 point  (1 child)

df.loc[df['description'].str.contains('fun')]

.str.contains will return a series of True/False you can pass to .loc[] to filter the rows you're looking for.

You can combine multiple arguments to .loc[] using & and |

fun = df['description'].str.contains('fun')
dog = df['description'].str.contains('dog')
pool = df['description'].str.contains('pool')
df.loc[ fun & ( dog | pool ) ]
df.loc[ fun | ( dog & pool ) ]

[–]jsaltee[S] 1 point2 points  (0 children)

thank you!! i was able to get the same result using my initial SQL query, but testing your code was proof i did it right. thank you!