You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Rok Mihevc (Jira)" <ji...@apache.org> on 2023/01/11 07:22:03 UTC

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

    [ https://issues.apache.org/jira/browse/ARROW-2514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17659540#comment-17659540 ] 

Rok Mihevc commented on ARROW-2514:
-----------------------------------

This issue has been migrated to [issue #18790|https://github.com/apache/arrow/issues/18790] on GitHub. Please see the [migration documentation|https://github.com/apache/arrow/issues/14542] for further details.

> [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
>            Assignee: Antoine Pitrou
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.10.0
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> 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
(v8.20.10#820010)