Following on from the question here:
I'm trying to create the series by hand here using Rpy2
import rpy2.robjects as ro
from rpy2.robjects.packages import importr
import pandas.rpy.common as com
pa = importr("pa")
ro.r("data(jan)")
jan = com.load_data('jan')
jan_r = com.convert_to_r_dataframe(jan)
name = ro.StrVector([str(i) for i in jan['name']])
sector = ro.StrVector([str(i) for i in jan['sector']])
date = ro.StrVector([str(i) for i in jan['date']])
and I get at date number of 14610
in the date field representing 2010-01-01
which I suspect is a 1970-01-01
origin. I can't find anything in the datetime
module that will allow me to change the origin for the date however so I don't know how to reset it.
My questions:
- Is the origin for the R sourced date
1970-01-01
? - Is there a way to set an origin and covert to a
datetime.datetime
object in python? - Am I missing something more obvious here?
Thanks