git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (ARROW-2514) [Python] Inferring / converting nested Numpy array is very slow


Antoine Pitrou created ARROW-2514:
-------------------------------------

             Summary: [Python] Inferring / converting nested Numpy array is very slow
                 Key: ARROW-2514
                 URL: https://issues.apache.org/jira/browse/ARROW-2514
             Project: Apache Arrow
          Issue Type: Bug
          Components: Python
    Affects Versions: 0.9.0
            Reporter: Antoine Pitrou


Converting a nested Numpy array nested walks over the Numpy data as Python objects, even if the dtype is not "object". This makes it pointlessly slow compared to the non-nested case, and even the nested Python list case:

{code:python}
>>> %%timeit data = list(range(10000))
...:pa.array(data)
...:
746 µs ± 8.36 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
>>> %%timeit data = np.arange(10000)
...:pa.array(data)
...:
81.1 µs ± 57.7 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
>>> %%timeit data = [np.arange(10000)]
...:pa.array(data)
...:
3.39 ms ± 6.27 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)



( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-arrow-development/msg04297.html on line 104
Call Stack
#TimeMemoryFunctionLocation
10.0007364632{main}( ).../msg04297.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-arrow-development/msg04297.html on line 104
Call Stack
#TimeMemoryFunctionLocation
10.0007364632{main}( ).../msg04297.html:0