I have a dataset that has a date column and a time column, I'm trying to combine them in a DateTime column but I'm facing an issue with the month & date parts of it being reversed
For example:
Date Time
1/2/2019 3:29:59 PM
4/2/2019 9:15:59 AM
These dates are Feb 1st & Feb 4th of 2019.
When I put them in my DataFrame & format them:
data = pd.read_csv('{}/{}.csv'.format(data_path,symbol), parse_dates=[['Date','Time']])
data.columns = map(str.lower, data.columns)
data['timedelta'] = pd.Series([pd.Timedelta(seconds=59) for i in range(len(data['date_time']))])
data['date_time'] = data['date_time'] - data['timedelta']
data = data.set_index('date_time').tz_localize('Asia/Kolkata')
I get this output:
Datetime
2019-01-02 15:29:00+0530
2019-04-02 09:15:00+0530
As you can see, the DateTime object is for Jan 2nd and April 2nd of 2019.
I'd appreciate your help to figure out how to get the DateTime column formatted correctly.