What is python’s equivalent of R’s NA?
nan in numpy is handled well with many functions: >>> import numpy as np >>> a = [1, np.nan, 2, 3] >>> np.nanmean(a) 2.0 >>> np.nansum(a) 6.0 >>> np.isnan(a) array([False, True, False, False], dtype=bool)
nan in numpy is handled well with many functions: >>> import numpy as np >>> a = [1, np.nan, 2, 3] >>> np.nanmean(a) 2.0 >>> np.nansum(a) 6.0 >>> np.isnan(a) array([False, True, False, False], dtype=bool)