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']