You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wes McKinney (JIRA)" <ji...@apache.org> on 2018/12/27 19:18:01 UTC

[jira] [Commented] (ARROW-3030) [Python] Create UnionArray from mixed-type pandas categorical

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

Wes McKinney commented on ARROW-3030:
-------------------------------------

Moved out of 0.12. We don't have much support for unions yet, which is what would be needed here. That's a bigger project

In the meantime I suggest homogenizing the types of your data to not have a mix of integers and strings

> [Python] Create UnionArray from mixed-type pandas categorical
> -------------------------------------------------------------
>
>                 Key: ARROW-3030
>                 URL: https://issues.apache.org/jira/browse/ARROW-3030
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 0.10.0
>            Reporter: Christopher Brooks
>            Priority: Major
>
> While troublehsooting ARROW-2966 I updated my pandas dataframe with more type information. Specifically, I changed some mixed type columns to categorical instead of object. I assumed that the Table.from_pandas() would inspect the pandas type information and respect that when converting it over to a table. It doesn't seem to.
> For instance, I expected this code to work, but it throws the same ArrowTypeError as ARROW-2966.
>  
> {code:java}
> import pandas as pd
> import pyarrow as pa
> import numpy as np
> df=pd.DataFrame.from_dict({"col":[0,1,2,3,""]},dtype="category")
> tb = pa.Table.from_pandas(df, columns=["col"])
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)