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

[jira] [Commented] (ARROW-13806) [Python] Add conversion to/from Pandas/Python for Month, Day Nano Interval Type

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

Micah Kornfield commented on ARROW-13806:
-----------------------------------------

[~tswast] suggested [https://pandas.pydata.org/docs/reference/api/pandas.tseries.offsets.DateOffset.html] as a possible type I didn't look into how fields are stored in it yet.  Open to suggestion, if no type really maps well then numpy struct seems like a reasonable default to me.

 

I'll try to tackle conversion of the existing types as well.  After reviewing I'll try to make reasonable choices but if there are strong inclinations.  For standard python types my inclination is to map:

DayMillis to datetime.timedelta (according to docs it stores days, seconds and microseconds as separate fields).  Not sure about the reverse mapping though

For numpy-based conversion of months, timedelta64[M] sounds good to me. 

 

For month day nanos, I think if DateOffset doesn't work for numpy, the struct type seems correct to me.  For python, I think maybe just a triple (namedtuple) in the arrow namespace might make sense.

> [Python] Add conversion to/from Pandas/Python for Month, Day Nano Interval Type
> -------------------------------------------------------------------------------
>
>                 Key: ARROW-13806
>                 URL: https://issues.apache.org/jira/browse/ARROW-13806
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Python
>            Reporter: Micah Kornfield
>            Assignee: Micah Kornfield
>            Priority: Major
>
> [https://github.com/apache/arrow/pull/10177] has been merged we should support conversion to and from this type for standard python surface areas.



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