Skip to content

Conversation

milkypostman
Copy link

Check to see if the values we're looking at are numpy datetime64
objects. If they are, we can assume we're looking at a Timestamp object,
which subclasses Python's datetime class, and we return a struct_time
which is understood by rpy2's POSIXct class.

Attempt at a fix for #2351

@lbeltrame
Copy link
Contributor

Nice. I left those out when I wrote support for conversions mainly because I did not use any of the datetime features (on R and Python). As one who wrote the code, you get a +1 from me.

Check to see if the values we're looking at are numpy datetime64
objects. If they are, we can assume we're looking at a Timestamp object,
which subclasses Python's datetime class, and we return a struct_time
which is understood by rpy2's POSIXct class.
@wesm
Copy link
Member

wesm commented Dec 1, 2012

Cherry-picked this commit. It'd be great to see some tests for this at some point (separate PR is fine)

@wesm wesm closed this Dec 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants