diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-03-28 21:07:15 +0100 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-03-30 20:39:04 +0200 |
commit | d36f82277056b053578f1672c6db22371f9d991a (patch) | |
tree | 5816018478676721662d0b15e8820b3aa0bcc5fd /numpy/lib/nanfunctions.py | |
parent | ceeeb1a65aaa508bd7097b5c39ba36fec51934b9 (diff) | |
download | numpy-d36f82277056b053578f1672c6db22371f9d991a.tar.gz |
ENH: optimize array creation from homogenous python sequences
Instead calling PyArray_DTypeFromObjectHelper for each item in a
sequence, check if all items in the sequence are of the same scalar
type, if this is the case we only need to recurse on one item.
Also use the PySequence_Fast API to avoid expensive function calls for
the common case of lists or tuples.
np.array(range(10)) improves about 25%
np.array(range(100)) improves about 40%
Diffstat (limited to 'numpy/lib/nanfunctions.py')
0 files changed, 0 insertions, 0 deletions