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 2019/02/06 04:28:00 UTC

[jira] [Closed] (ARROW-2148) [Python] to_pandas() on struct array returns object array

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

Wes McKinney closed ARROW-2148.
-------------------------------
    Resolution: Won't Fix

pandas doesn't support NumPy structured dtypes

> [Python] to_pandas() on struct array returns object array
> ---------------------------------------------------------
>
>                 Key: ARROW-2148
>                 URL: https://issues.apache.org/jira/browse/ARROW-2148
>             Project: Apache Arrow
>          Issue Type: Bug
>            Reporter: Antoine Pitrou
>            Priority: Major
>
> This should probably return a Numpy struct array instead:
> {code:python}
> >>> arr = pa.array([{'a': 1, 'b': 2.5}, {'a': 2, 'b': 3.5}], type=pa.struct([pa.field('a', pa.int32()), pa.field('b', pa.float64())]))
> >>> arr.type
> StructType(struct<a: int32, b: double>)
> >>> arr.to_pandas()
> array([{'a': 1, 'b': 2.5}, {'a': 2, 'b': 3.5}], dtype=object)
> {code}



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