I have a pandas dataframe:
lat lng alt days date time 0 40.003834 116.321462 211 39745.175405 2008-10-24 04:12
You are not creating datetime index properly,
format = '%Y-%m-%d %H:%M:%S' df['Datetime'] = pd.to_datetime(df['date'] + ' ' + df['time'], format=format) df = df.set_index(pd.DatetimeIndex(df['Datetime']))