You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "David Li (Jira)" <ji...@apache.org> on 2021/12/28 17:52:00 UTC

[jira] [Updated] (ARROW-15202) [Python] Create pyarrow array using an object's `__array__` method.

     [ https://issues.apache.org/jira/browse/ARROW-15202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Li updated ARROW-15202:
-----------------------------
    Summary: [Python] Create pyarrow array using an object's `__array__` method.  (was: Create pyarrow array using an object's `__array__` method.)

> [Python] Create pyarrow array using an object's `__array__` method.
> -------------------------------------------------------------------
>
>                 Key: ARROW-15202
>                 URL: https://issues.apache.org/jira/browse/ARROW-15202
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Python
>    Affects Versions: 6.0.1
>            Reporter: A. Coady
>            Priority: Minor
>
> `pa.array` supports optimized creation from an object with the `__arrow_array__` method, or from a literal NumPy ndarray. But there's a performance gap if the input object has only an `__array__` method, as it isn't used.
>  
> So the user has to know to call `np.asarray` first. And even if the original object could be extended to support '__arrow_array__`, it doesn't seems like a great workaround if all that method would do is call `pa.array(np.asarray(self))`.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)