pandas.Timedelta¶
-
class
pandas.Timedelta¶ Represents a duration, the difference between two dates or times.
Timedelta is the pandas equivalent of python’s
datetime.timedeltaand is interchangable with it in most cases.Parameters: value : Timedelta, timedelta, np.timedelta64, string, or integer
unit : string, [D,h,m,s,ms,us,ns]
Denote the unit of the input, if input is an integer. Default ‘ns’.
days, seconds, microseconds,
milliseconds, minutes, hours, weeks : numeric, optional
Values for construction in compat with datetime.timedelta. np ints and floats will be coereced to python ints and floats.
Notes
The
.valueattribute is always in ns.Attributes
asm8return a numpy timedelta64 array view of myself componentsReturn a Components NamedTuple-like daysNumber of Days deltareturn out delta in ns (for internal compat) freqis_populatedmicrosecondsNumber of microseconds (>= 0 and less than 1 second). nanosecondsNumber of nanoseconds (>= 0 and less than 1 microsecond). resolutionreturn a string representing the lowest resolution that we have secondsNumber of seconds (>= 0 and less than 1 day). valueMethods
ceilreturn a new Timedelta ceiled to this resolution floorreturn a new Timedelta floored to this resolution isoformatFormat Timedelta as ISO 8601 Duration like P[n]Y[n]M[n]DT[n]H[n]M[n]S, where the `[n]`s are replaced by the values. roundRound the Timedelta to the specified resolution to_pytimedeltareturn an actual datetime.timedelta object to_timedelta64Returns a numpy.timedelta64 object with ‘ns’ precision total_secondsTotal duration of timedelta in seconds (to ns precision) viewarray view compat