Format the Timedelta as ISO 8601 Duration.
P[n]Y[n]M[n]DT[n]H[n]M[n]S
, where the [n]
s are replaced by the values. See https://en.wikipedia.org/wiki/ISO_8601#Durations.
See also
Timestamp.isoformat
Function is used to convert the given Timestamp object into the ISO format.
Notes
The longest component is days, whose value may be larger than 365. Every component is always included, even if its value is 0. Pandas uses nanosecond precision, so up to 9 decimal places may be included in the seconds component. Trailing 0âs are removed from the seconds component after the decimal. We do not 0 pad components, so itâs â¦T5Hâ¦, not â¦T05Hâ¦
Examples
>>> td = pd.Timedelta(days=6, minutes=50, seconds=3, ... milliseconds=10, microseconds=10, nanoseconds=12)
>>> td.isoformat() 'P6DT0H50M3.010010012S' >>> pd.Timedelta(hours=1, seconds=10).isoformat() 'P0DT1H0M10S' >>> pd.Timedelta(days=500.5).isoformat() 'P500DT12H0M0S'
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4