26.10.2011 09:09, Grové kirjoitti: > I have picked up a strange limit to np.in1d(): > ---------- > > b > Out[100]: > array(['2007-01-01T02:30:00+0200', '2007-01-01T03:00:00+0200', > '2007-01-01T03:30:00+0200', ..., '2008-01-01T01:00:00+0200', > '2008-01-01T01:30:00+0200', '2008-01-01T02:00:00+0200'], > dtype='datetime64[s]') > > b.shape > Out[101]: (17520,) > > a = b[0:42] > > np.in1d(b,a) > --------------------------------------------------------------------------- > TypeError Traceback (most recent call last) [clip] > In other words the limit seems to be 41 elements for a. Is this a bug or am > I > getting something wrong?
The problem here seems to be that argsort (or only the mergesort?) for datetime datatypes is not implemented. There's a faster code path that is triggered for small selection arrays, and that does not require argsort, and that's why the error occurs in only some of the cases. -- Pauli Virtanen _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion