SyntaxFix
Write A Post
Hire A Developer
Questions
You can replace nan with None in your numpy array:
nan
None
>>> x = np.array([1, np.nan, 3]) >>> y = np.where(np.isnan(x), None, x) >>> print y [1.0 None 3.0] >>> print type(y[1]) <type 'NoneType'>