Timestamps have a replace method (just like datetimes):
In [11]: df.index.map(lambda t: t.replace(year=2013, month=2, day=1)) Out[11]: array([Timestamp('2013-02-01 10:00:00', tz=None), Timestamp('2013-02-01 10:05:00', tz=None), Timestamp('2013-02-01 10:10:00', tz=None), Timestamp('2013-02-01 10:15:00', tz=None)], dtype=object)
So, set for this index:
In [12]: df.index = df.index.map(lambda t: t.replace(year=2013, month=2, day=1))
It is worth mentioning that you can pass the date_parser function to read_csv , which may make more sense to you:
In [21]: df = pd.read_csv(file_name, sep=';', parse_dates=[0], index_col=0, date_parser=lambda time: pd.Timestamp('2013/02/01 %s' % time)) In [22]: df Out[22]: val TS 2013-02-01 10:00:00 0.1 2013-02-01 10:05:00 0.2 2013-02-01 10:10:00 0.3 2013-02-01 10:15:00 0.4
source share