df.replace('', np.nan, inplace=True)
import numpy as np
l=['foo', 'bar', 'baz', np.nan]
l_new=['missing' if x is np.nan else x for x in l]
print l_new
# Result:
# ['foo', 'bar', 'baz', 'missing']
from numpy import *
a = array([[1, 2, 3], [0, 3, NaN]])
where_are_NaNs = isnan(a)
a[where_are_NaNs] = 0