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:13:04 UTC

[jira] [Commented] (ARROW-1074) from_pandas doesnt convert ndarray to list

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

Rok Mihevc commented on ARROW-1074:
-----------------------------------

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

> from_pandas doesnt convert ndarray to list
> ------------------------------------------
>
>                 Key: ARROW-1074
>                 URL: https://issues.apache.org/jira/browse/ARROW-1074
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 0.4.0
>            Reporter: Abdul Rahman
>            Assignee: Florian Jetter
>            Priority: Minor
>              Labels: pyarrow
>             Fix For: 0.5.0
>
>
> [Feel free to change issue type because this is probably by design]
> I have noticed that that if the one of the columns in the parquet file is of type array, pyarrow table stores it as list
> >>> table[3].type
> DataType(list<element: string>)
> If I do a .to_pandas() on the column, I get something like this
> >> table[3].to_pandas()
> 0         None                                                                                                     
> 1          [7]                                                                                                     
> 2         [46]  
> dtype: object
> However, I cant do a pyarrow.Table.from_pandas from a dataframe having the above ndarray as a series/column. I get this error
> Invalid: Python object of type ndarray is not None and is not a string, bool, float, int, date,
> decimal object
> If to_pandas() can covert a list to ndarray, shouldnt from_pandas also convert an ndarray to type list in the table ?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)