Initially I've got
print(transactions.Date.loc[0])
>>>30/04/18
First I've done
transactions['Date'] = pd.to_datetime(transactions['Date'])
Now
print(transactions.Date.loc[0])
>>>2018-04-30 00:00:00
After that I check for an equality condition like so
transactions.Date.loc[0] + datetime.timedelta(days=1) == transactions.Date.loc[1]
>>>False
So I examine
print(transactions.Date.loc[0] + datetime.timedelta(days=1))
>>>2018-05-01 00:00:00
print(transactions.Date.loc[1])
>>>2018-01-05 00:00:00
Turns out both refer to same time, but with a different format. How do I modify my code to get True
on equality?
EDIT: As pointed in the comments, the problem is actually May 1 being transformed to January 5 when I use pd.to_datetime. So the new question is how do I resolve this?