Back
I have a pandas column of Timestamp data
In [27]: train["Original_Quote_Date"][6] Out[27]: Timestamp('2013-12-25 00:00:00')
In [27]: train["Original_Quote_Date"][6]
Out[27]: Timestamp('2013-12-25 00:00:00')
How can check equivalence of these objects to datetime.date objects of the type
datetime.date(2013, 12, 25)
Converting Timestamp to datetime.date using .date method::
t = pd.Timestamp('2013-12-25 00:00:00')t.date()datetime.date(2013, 12, 25)t.date() == datetime.date(2013, 12, 25)
t = pd.Timestamp('2013-12-25 00:00:00')
t.date()
t.date() == datetime.date(2013, 12, 25)
Output:
True
31k questions
32.8k answers
501 comments
693 users