I am currently working on multiple datasets with TimeStamp column : dd/mm/yyyy HH:MM daily data at 5 mins interval i want to resample dataset to fill missing dates n timestamps
Issue is few datasets have some rows as ddmmyy and then format abruptly changes to mmddyyyy after say first few 100 rows and again ddmmyy without any pattern...
need solution or help to correct this issue
code i am using :::
df['Timestamp'] = pd.to_datetime(df['Timestamp'])
df['Timestamp'] = df.Timestamp.dt.strftime('%d/%m/%y %H:%M')
df['Timestamp'] = pd.to_datetime(df['Timestamp'])
start_dt = df.loc[0, "Timestamp"]
end_dt = df["Timestamp"].iloc[-1]
r = pd.date_range(start=start_dt, end=end_dt, freq="5min")
# Reindexing by adding missing dates
df = df.set_index('Timestamp').reindex(r).rename_axis("Timestamp").reset_index()