diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-05-16 18:54:57 +0200 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-05-26 18:35:50 +0200 |
commit | d438067813867bc34546b6f1f1683d5981994812 (patch) | |
tree | 9d426995274843abaf9256ad49c4872eaa4978c4 /numpy/lib/nanfunctions.py | |
parent | 5bbccc5940dba709a0e90f1f433674cc625aa4ad (diff) | |
download | numpy-d438067813867bc34546b6f1f1683d5981994812.tar.gz |
ENH: avoid expensive PyArg_ParseTuple in void operations
Replace simple "Oi|O" unpack with faster specialized unpacking
Improves e.g.:
nrows, ncols = 365, 10000
items = np.rec.fromarrays(randn(2,265, 10000), names=['widgets','gadgets'])
row_idx, colidx = randint(0, nrows, ncols), np.arange(ncols)
%timeit filtered_items = items[row_idx, col_idx]
In [7]: %timeit filtered_items = items[row_idx, col_idx]
1000 loops, best of 3: 1.55 ms per loop
to
In [7]: %timeit filtered_items = items[row_idx, col_idx]
1000 loops, best of 3: 706 µs per loop
Diffstat (limited to 'numpy/lib/nanfunctions.py')
0 files changed, 0 insertions, 0 deletions