@@ -19,22 +19,24 @@ def to_timedelta(arg, unit='ns', box=True, errors='raise'):
19
19
Convert argument to timedelta.
20
20
21
21
Timedeltas are absolute differences in times, expressed in difference
22
- units e.g. (days, hours, minutes, seconds). This method converts an argument
23
- from a recognized timedelta format / value into a Timedelta type.
22
+ units (e.g. days, hours, minutes, seconds). This method converts
23
+ an argument from a recognized timedelta format / value into
24
+ a Timedelta type.
24
25
25
26
Parameters
26
27
----------
27
- arg : string, timedelta, list, tuple, 1-d array, or Series
28
+ arg : str, timedelta, list-like or Series
29
+ The argument which needs to be converted to timedelta.
28
30
unit : str, default 'ns'
29
- Possible values:
30
- {'Y', 'M ', 'W ', 'D ', 'days ', 'day ', 'hours ', hour', 'hr' , 'h ',
31
- 'm', 'minute ', 'min ', 'minutes ', 'T ', 'S', 'seconds', 'sec', 'second ',
32
- 'ms ', 'milliseconds ', 'millisecond ', 'milli ', 'millis ', 'L ',
33
- 'us ', 'microseconds ', 'microsecond ', 'micro ', 'micros ', 'U ',
34
- 'ns', 'nanoseconds', 'nano', 'nanos', ' nanosecond', 'N'}
35
- box : Boolean , default True
31
+ ('Y', 'M', 'W', 'D', 'days', 'day', 'hours', hour', 'hr',
32
+ 'h ', 'm ', 'minute ', 'min ', 'minutes ', 'T ', 'S' , 'seconds ',
33
+ 'sec ', 'second ', 'ms ', 'milliseconds ', 'millisecond ',
34
+ 'milli ', 'millis ', 'L ', 'us ', 'microseconds ', 'microsecond ',
35
+ 'micro ', 'micros ', 'U ', 'ns ', 'nanoseconds ', 'nano', 'nanos ',
36
+ ' nanosecond', 'N').
37
+ box : bool , default True
36
38
If True returns a Timedelta/TimedeltaIndex of the results.
37
- if False returns a np.timedelta64 or ndarray of values of dtype
39
+ If False returns a np.timedelta64 or ndarray of values of dtype
38
40
timedelta64[ns].
39
41
errors : {'ignore', 'raise', 'coerce'}, default 'raise'
40
42
- If 'raise', then invalid parsing will raise an exception.
0 commit comments