4 Jul
2006
4 Jul
'06
3:21 p.m.
David Huard wrote:
Here is a quick benchmark between numpy's unique, unique1d and sasha's unique:
x = rand(100000)*100 x = x.astype('i')
%timeit unique(x) 10 loops, best of 3: 525 ms per loop
%timeit unique_sasha(x) 100 loops, best of 3: 10.7 ms per loop
timeit unique1d(x) 100 loops, best of 3: 12.6 ms per loop
So I wonder what is the added value of unique? Could unique1d simply become unique ?
It looks like unique1d and friends could use same facelifting with new numpy features like boolean indexing :) r.