import pandas as pd def reset_index(_df: pd.DataFrame): df = _df.reset_index() df['datetime'] =_df.index.astype(str) return df