Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
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
Python Pandas - Return the minimum value of the Timedelta object
To return the maximum value of the Timedelta object, timedelta.min property. At first, import the required libraries −
import pandas as pd
TimeDeltas is Python’s standard datetime library uses a different representation timedelta’s. Create a Timedelta object
timedelta = pd.Timedelta('2 days 1 min 15 s 20 ns')
Return the minimum value
timedelta.min
Example
Following is the code
import pandas as pd
# TimeDeltas is Python’s standard datetime library uses a different representation timedelta’s
# create a Timedelta object
timedelta = pd.Timedelta('2 days 1 min 15 s 20 ns')
# display the Timedelta
print("Timedelta...\n", timedelta)
# return the minimum value
res = timedelta.min
# display the minimum value
print("\nTimedelta (min value)...\n", res)
Output
This will produce the following code
Timedelta... 2 days 00:01:15.000000020 Timedelta (min value)... -106752 days +00:12:43.145224193
Advertisements