Skip to content

convert_to_r_dataframe missing conversion for datetime values #2351

@milkypostman

Description

@milkypostman

I am in desperate need of converting my datetime values into something R can use so I that I can plot some data with ggplot. It appears that rpy2 supports this conversion but I am not sure how to go from a column with a datetime field (stored as a numpy.datetime64) into a time.struct_time value.

The relevant information about rpy2 is here: http://rpy.sourceforge.net/rpy2/doc-2.2/html/vector.html?highlight=intvector#rpy2.robjects.vectors.POSIXlt

I see that there need to be some minor changes on line 244 of common.py but basically I am stuck on trying to figure out how to convert from numpy.datetime64 into the struct_time. I see that there is already functionality in Pandas, specifically the to_pydatetime function, for converting from this numpy format into a datetime object.

If someone could lead me over this hump I'd be happy to submit the pull request.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions