@@ -26,18 +26,19 @@ def to_timedelta(arg, unit='ns', box=True, errors='raise'):
26
26
Parameters
27
27
----------
28
28
arg : str, timedelta, list-like or Series
29
- The argument which needs to be converted to timedelta.
29
+ The data to be converted to timedelta.
30
30
unit : str, default 'ns'
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').
31
+ Denotes the unit of the arg. Possible values:
32
+ ('Y', 'M', 'W', 'D', 'days', 'day', 'hours', hour', 'hr',
33
+ 'h', 'm', 'minute', 'min', 'minutes', 'T', 'S', 'seconds',
34
+ 'sec', 'second', 'ms', 'milliseconds', 'millisecond',
35
+ 'milli', 'millis', 'L', 'us', 'microseconds', 'microsecond',
36
+ 'micro', 'micros', 'U', 'ns', 'nanoseconds', 'nano', 'nanos',
37
+ 'nanosecond', 'N').
37
38
box : bool, default True
38
- If True returns a Timedelta/TimedeltaIndex of the results.
39
- If False returns a np .timedelta64 or ndarray of values of dtype
40
- timedelta64[ns].
39
+ - If True returns a Timedelta/TimedeltaIndex of the results.
40
+ - If False returns a numpy .timedelta64 or numpy.darray of
41
+ values of dtype timedelta64[ns].
41
42
errors : {'ignore', 'raise', 'coerce'}, default 'raise'
42
43
- If 'raise', then invalid parsing will raise an exception.
43
44
- If 'coerce', then invalid parsing will be set as NaT.
@@ -83,12 +84,6 @@ def to_timedelta(arg, unit='ns', box=True, errors='raise'):
83
84
84
85
>>> pd.to_timedelta(np.arange(5), box=False)
85
86
array([0, 1, 2, 3, 4], dtype='timedelta64[ns]')
86
- <<<<<<< HEAD
87
-
88
- See also
89
-
90
- =======
91
- >>>>>>> improved styling
92
87
"""
93
88
unit = parse_timedelta_unit (unit )
94
89
0 commit comments