What is the difference between these two methods to delete a row if the string 'something' is found in the column 'search'?
First method:
mydata = mydata.set_index("search")
mydata = mydata.drop("something", axis=0)
This method seems pretty straight forward and is understandable.
Second method:
mydata = mydata[~mydata.select_dtypes(['object']).eq('something').any(1)]
I don't really know how this method works. Where in this line is it specified to drop/delete the row? And why does it work with 'object' instead of 'search'? What does the "~" stand for? I just can't find it in the documentation.