What happened to python's ~ when working with boolean? : <p>In a pandas DataFrame, I have a series of boolean values. In order to filter to rows where the boolean is True, I can use: <code>df[df.column_x]</code></p>

<p>I thought in order to filter to only rows where the column is False, I could use: <code>df[~df.column_x]</code>. I feel like I have done this before, and have seen it as the accepted answer. </p>

<p>However, this fails because <code>~df.column_x</code> converts the values to integers. See below. </p>

<pre><code>import pandas as pd . # version 0.24.2

a = pd.Series(['a', 'a', 'a', 'a', 'b', 'a', 'b', 'b', 'b', 'b'])
b = pd.Series([True, True, True, True, True, False, False, False, False, False], dtype=bool)

c = pd.DataFrame(data=[a, b]).T
c.columns = ['Classification', 'Boolean']```

print(~c.Boolean)

0    -2
1    -2
2    -2
3    -2
4    -2
5    -1
6    -1
7    -1
8    -1
9    -1
Name: Boolean, dtype: object

print(~b)

0    False
1    False
2    False
3    False
4    False
5     True
6     True
7     True
8     True
9     True
dtype: bool

</code></pre>

<p>Basically, I can use <code>c[~b]</code>, but not <code>c[~c.Boolean]</code></p>

<p>Am I just dreaming that this use to work?</p>
