I have a python pandas dataframe df with a lot of rows. From those rows, I want to slice out and only use the rows that contain the word 'ball' in the 'body' column. To do that, I can do:
df[df['body'].str.contains('ball')]
The issue is, I want it to be case insensitive, meaning that if the word Ball or bAll showed up, I'll want those as well. One way to do case insensitive search is to turn the string to lowercase and then search that way. I'm wondering how to go about doing that. I tried
df[df['body'].str.lower().contains('ball')]
But that doesn't work. I'm not sure if I'm supposed to use a lambda function on this or something of that nature.