How can I obtain the element-wise logical NOT of a pandas Series?

I have a pandas Series object containing boolean values. How can I get a series containing the logical NOT of each value?

For example, consider a series containing:

True
True
True
False

The series I’d like to get would contain:

False
False
False
True

This seems like it should be reasonably simple, but apparently I’ve misplaced my mojo =(

6 Answers
6

Leave a Comment