Toolbox for handling NaNs in Python 2.7
First of all, visualize the missing values :

I am using Python 2.7

import pandas
import numpy
from pandas import DataFrame
import seaborn as sns

df = DataFrame({'A' : [0,1,numpy.nan, 5 ,6],'B':[30,numpy.nan,numpy.nan,8,10]})
df

     A  B
0   0.0 30.0
1   1.0 NaN
2   NaN NaN
3   5.0 8.0
4   6.0 10.0
sns.heatmap(df.isnull(),yticklabels=False,cbar=False,cmap='BuPu')


If u wanna drop rows containing missing values,

df.dropna(axis=0)

        A   B
    0   0.0 30.0
    3   5.0 8.0
    4   6.0 10.0


If u wanna drop columns containing missing values,

df.dropna(axis=1)


If you wanna fill NaN with a value:

df.fillna(0)


  A B
0   0.0 30.0
1   1.0 0.0
2   0.0 0.0
3   5.0 8.0
4   6.0 10.0


You can do a ffill/pad, bfill/backfill. Hit shit tab and expand the documentation if you are using jupyter.

For more info refer : https://pandas.pydata.org/pandas-docs/stable/missing_data.html

I hope this answers your question.