0 votes
1 view
in Data Science by (17.6k points)

I have a pandas column of Timestamp data

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)

1 Answer

0 votes
by (32.5k points)

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)

Output:

True

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...