I have a pandas series myS
import pandas as pd
The index is a set of strings containing time only
myS.index
Out[28]:
Index([u'12:00 AM', u'12:14 AM', u'12:18 AM', u'12:25 AM', u'12:26 AM',
u'12:37 AM', u'12:41 AM', u'12:47 AM', u'12:55 AM', u'12:59 AM',
...
u'11:00 PM', u'11:02 PM', u'11:09 PM', u'11:18 PM', u'11:25 PM',
u'11:35 PM', u'11:42 PM', u'11:46 PM', u'11:50 PM', u'11:55 PM'],
dtype='object', name=u'Time (CET)', length=169)
I can conveniently convert this to datetime correctly:
myS.index= pd.to_datetime(myS.index, format='%I:%M %p')
However, all the dates will be set to 1900-01-01
'1900-01-01 23:50:00', '1900-01-01 23:55:00'],
dtype='datetime64[ns]',
If I have a datetime available, how can I reset all the dates of the index to a desired value while leaving intact the time?