How to drop null values in Pandas?
<p>I try to drop null values of column 'Age' in dataframe, which consists of float values, but it doesn't work.
I tried</p>

<pre><code>data.dropna(subset=['Age'], how='all')
data['Age'] = data['Age'].dropna()
data=data.dropna(axis=1,how='all')
</code></pre>

<p>It works for other columns but not for 'Age'</p>

<pre><code>    Pclass  Fare    Age Sex
0   3   7.2500  22.0    1
1   1   71.2833 38.0    0
2   3   7.9250  26.0    0
3   1   53.1000 35.0    0
4   3   8.0500  35.0    1
5   3   8.4583  NaN 1
6   1   51.8625 54.0    1
7   3   21.0750 2.0 1
</code></pre>

<p><code>data.dropna(subset=['Age'])</code> would work, but you should either set <code>inplace=True</code> or assign it back to <code>data</code>:</p>

<pre><code>data = data.dropna(subset=['Age'])
</code></pre>

<p>or </p>

<pre><code>data.dropna(subset=['Age'], inplace=True)
</code></pre>

python pandas