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/08 04:32:00 UTC

[jira] [Resolved] (ARROW-3899) [Python] Table.to_pandas converts Arrow date32[day] to pandas datetime64[ns]

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

Wes McKinney resolved ARROW-3899.
---------------------------------
       Resolution: Fixed
         Assignee: Wes McKinney
    Fix Version/s:     (was: 0.13.0)
                   0.12.0

This was resolved in 0.12. On master now

{code}
In [4]: arr = pa.array([date(2001, 1, 1), None, date(2001, 1, 2)])                                                                                                                             

In [5]: arr                                                                                                                                                                                    
Out[5]: 
<pyarrow.lib.Date32Array object at 0x7f033ceb7ae8>
[
  11323,
  null,
  11324
]

In [6]: arr.to_pandas()                                                                                                                                                                        
Out[6]: 
array([datetime.date(2001, 1, 1), None, datetime.date(2001, 1, 2)],
      dtype=object)
{code}

> [Python] Table.to_pandas converts Arrow date32[day] to pandas datetime64[ns]
> ----------------------------------------------------------------------------
>
>                 Key: ARROW-3899
>                 URL: https://issues.apache.org/jira/browse/ARROW-3899
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Python
>            Reporter: Wes McKinney
>            Assignee: Wes McKinney
>            Priority: Major
>             Fix For: 0.12.0
>
>
> This issue was raised here:
> https://github.com/wesm/feather/issues/359
> I explored this minimally against Arrow master:
> https://gist.github.com/wesm/2ebe0ca2461d1ecfba6185777238ad1f
> While it's pretty memory-wasteful, it might be better to preserve the intent of the data type when converting to pandas data structures. It also allows the data to round trip successfully



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