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

[jira] [Commented] (ARROW-15033) [Python] No way to create ListArray from sub-arrays

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

Vlad Firoiu commented on ARROW-15033:
-------------------------------------

Here's what I'm looking for:
{code:python}
reference = pa.array([[1, 2, 3], [4, 5, 6]])

sub_arrays = [
  pa.array([1, 4]),
  pa.array([2, 5]),
  pa.array([3, 6]),
]

list_array = pa.ListArray.from_sub_arrays(sub_arrays)
assert list_array == reference
{code}

> [Python] No way to create ListArray from sub-arrays
> ---------------------------------------------------
>
>                 Key: ARROW-15033
>                 URL: https://issues.apache.org/jira/browse/ARROW-15033
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Python
>            Reporter: Vlad Firoiu
>            Priority: Major
>
> I'd like to create a `ListArray` from a list of sub-arrays, similar to how `StructArray.from_arrays` can create a `StructArray` from a sequence of names and arrays. A similarly-named function, `ListArray.from_arrays` does exist, but it does something completely different.



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