stites stites - 1 year ago 97
Python Question

search for "does-not-contain" on a dataframe in pandas

I've done some searching and can't figure out how to filter a dataframe by

, however I'm wondering if there is a way to do the reverse: filter a dataframe by that set's compliment. eg: to the effect of

Can this be done through a

Answer Source

You can use the invert (~) operator (which acts like a not for boolean data):


contains also accepts a regular expression...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download