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

[jira] [Updated] (ARROW-11600) Convert multi dimensional numpy array to pyarrow array

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

Bhavitvya Malik updated ARROW-11600:
------------------------------------
    Description: 
{{data = np.zeros((10,8), dtype=np.uint8)}}
 {{out = pa.array(list(data))}}
 {{out.type # ListType(list<item: uint8>)}}

{{data = np.zeros((3,4,6), dtype=np.uint8)}}
 {{out = pa.array(list(data)) # Throws error ArrowInvalid: Can only convert 1-dimensional array values}}

Even though it's working on 2D numpy arrays perfectly, it doesn't work on N-Dimensional numpy arrays (where N > 2). Is possible to extend the current feature for inner elements with dimension greater than 1?

  was:
{{}}

{{data = np.zeros((10,8), dtype=np.uint8)}}
{{out = pa.array(list(data))}}
{{out.type  # ListType(list<item: uint8>)}}

{{data = np.zeros((3,4,6), dtype=np.uint8)}}
{{out = pa.array(list(data))  # Throws error ArrowInvalid: Can only convert 1-dimensional array values}}

Even though it's working on 2D numpy arrays perfectly, it doesn't work on N-Dimensional numpy arrays (where N > 2). Is possible to extend the current feature for inner elements with dimension greater than 1?


> Convert multi dimensional numpy array to pyarrow array
> ------------------------------------------------------
>
>                 Key: ARROW-11600
>                 URL: https://issues.apache.org/jira/browse/ARROW-11600
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Python
>    Affects Versions: 2.0.0, 3.0.0
>            Reporter: Bhavitvya Malik
>            Priority: Major
>
> {{data = np.zeros((10,8), dtype=np.uint8)}}
>  {{out = pa.array(list(data))}}
>  {{out.type # ListType(list<item: uint8>)}}
> {{data = np.zeros((3,4,6), dtype=np.uint8)}}
>  {{out = pa.array(list(data)) # Throws error ArrowInvalid: Can only convert 1-dimensional array values}}
> Even though it's working on 2D numpy arrays perfectly, it doesn't work on N-Dimensional numpy arrays (where N > 2). Is possible to extend the current feature for inner elements with dimension greater than 1?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)