pandas - How to convert datetime.time columns in dataframe to string -
i've been struggling convert 2 columns in pandas. frame contains many columns, , 2 columns dates: 'datelog'(is date) , 'timeofday' (is time). column datelog string. column timeofday datetime.time() format. dateframe display folows:
datelog timeofday 0 30-apr-15 14:15:43 1 30-apr-15 14:16:13 2 30-apr-15 14:16:43 3 30-apr-15 14:17:13 4 30-apr-15 14:17:43 5 30-apr-15 14:18:13 6 30-apr-15 14:18:43 7 30-apr-15 14:19:13 8 30-apr-15 14:19:43 9 30-apr-15 14:20:13
my goal concatenate these 2 column use them index timeseries. can point me in right direction?
i think can use create index:
df.index = df['datelog'] + ' ' + df['timeofday'].astype(str)
Comments
Post a Comment