close

How do I convert timestamp to datetime.date in pandas dataframe?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How do I convert timestamp to datetime.date in pandas dataframe in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How do I convert timestamp to datetime.date in pandas dataframe?

  1. How do I convert timestamp to datetime.date in pandas dataframe?

    I got some help from a colleague.
    This appears to solve the problem posted above
    pd.to_datetime(df['mydates']).apply(lambda x: x.date())

  2. convert timestamp to datetime.date in pandas dataframe

    I got some help from a colleague.
    This appears to solve the problem posted above
    pd.to_datetime(df['mydates']).apply(lambda x: x.date())

Method 1

I got some help from a colleague.

This appears to solve the problem posted above

pd.to_datetime(df['mydates']).apply(lambda x: x.date())

Method 2

Much simpler than above:

df['mydates'].dt.date

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read