python - how to convert series integer to datetime in pandas -
i want convert integer type date datetime.
ex) : 20130601000011( 2013-6-1 00:00: 11 )
i don't know how use pd.to_datetime
please advice
thanks
ps. script below
rent_date_raw = pd.series(1, rent['rent_date']) return_date_raw = pd.series(1, rent['return_date']) rent_date = pd.series([pd.to_datetime(date) date in rent_date_raw]) daily_rent_ts = rent_date.resample('d', how='count') monthly_rent_ts = rent_date.resample('m', how='count')
pandas seems deal format fine long convert string first:
import pandas pd eg_date = 20130601000011 pd.to_datetime(str(eg_date)) out[4]: timestamp('2013-06-01 00:00:11')
your data @ moment more of string integer, since doesn't represent single number. different subparts of string reflect different aspects of time.
Comments
Post a Comment