diff options
author | Marten van Kerkwijk <mhvk@astro.utoronto.ca> | 2018-07-06 11:10:22 -0400 |
---|---|---|
committer | Marten van Kerkwijk <mhvk@astro.utoronto.ca> | 2018-07-06 12:40:25 -0400 |
commit | 5c42cc31fa1ac6bfaed50d7069d7bb8e8fd8bb53 (patch) | |
tree | ea54a46186621588509b8645a559ba9aa7115cdb /numpy/core/arrayprint.py | |
parent | 739443679b50b43c34808b8fb767bac643fcd91d (diff) | |
download | numpy-5c42cc31fa1ac6bfaed50d7069d7bb8e8fd8bb53.tar.gz |
MAINT: Speed up normalize_axis_tuple by about 30%
This is used in `np.moveaxis`, which is relatively slow.
Timings change as follows:
```
import numpy as np
from numpy.core.numeric import normalize_axis_tuple
%timeit normalize_axis_tuple([0, 1, 2], 4, 'parrot')
a = np.zeros((10,20,30))
%timeit np.moveaxis(a, [0,1,2], [2,1,0])
100000 loops, best of 3: 5.56 µs per loop -> 4.17 µs
```
Diffstat (limited to 'numpy/core/arrayprint.py')
0 files changed, 0 insertions, 0 deletions