Inverting Boolean Values in pandas Series: The tilde (~) Operator
Logical NOT in pandas SeriesIn pandas, a Series is a one-dimensional labeled array that can hold various data types, including booleans (True/False). The element-wise logical NOT operation (also known as negation) inverts the truth value of each element in a boolean Series