 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Pandas - Convert a Timestamp object to a native Python datetime object
To convert a Timestamp object to a native Python datetime object, use the timestamp.to_pydatetime() method.
At first, import the required libraries −
import pandas as pd
Create the timestamp object in Pandas
timestamp = pd.Timestamp('2021-09-11T13:12:34.261811')  Convert timestamp to native Python datetime object
timestamp.to_pydatetime()
Example
Following is the code
 import pandas as pd # set the timestamp object in Pandas timestamp = pd.Timestamp('2021-09-11T13:12:34.261811') # display the Timestamp print("Timestamp...\n", timestamp) # convert timestamp to native Python datetime object print("\nConvert Timestamp...\n", timestamp.to_pydatetime())  Output
This will produce the following code
Timestamp... 2021-09-11 13:12:34.261811 Convert Timestamp... 2021-09-11 13:12:34.261811
Advertisements
 