I am trying to convert a timestamp to a datetime to do some date comparisons but I cant seem to get it to work.
date = pd.to_datetime(df.at[i,"Date"])
however when I do date comparisons using the > and < operators its not always working. From what I have researched dates need to be set to datetime objects not timestamps.
but when i check the type of my date
variable it still shows as being a timestamp.
print(type(date))
<class 'pandas._libs.tslibs.timestamps.Timestamp'>
How can I convert this to a datetime object/variable ?