On Fri, Nov 22, 2013 at 4:23 PM, Matthew Brett <[email protected]>wrote:
> Hi, > > I'm sorry if I missed something obvious - but is there a vectorized > way to look for None in an array? > > In [3]: a = np.array([1, 1]) > > In [4]: a == object() > Out[4]: array([False, False], dtype=bool) > > In [6]: a == None > Out[6]: False > > (same for object arrays), > Looks like using a "scalar array" that holds the value None will work: In [8]: a Out[8]: array([[1, 2], 'foo', None], dtype=object) In [9]: a == np.array(None) Out[9]: array([False, False, True], dtype=bool) Warren > Thanks a lot, > > Matthew > _______________________________________________ > NumPy-Discussion mailing list > [email protected] > http://mail.scipy.org/mailman/listinfo/numpy-discussion >
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
