@@ -26,23 +26,28 @@ def to_timedelta(arg, unit='ns', box=True, errors='raise'):
26
26
27
27
Parameters
28
28
----------
29
- arg : String , timedelta, list, tuple, 1-d array, or Series
29
+ arg : str , timedelta, list, tuple, 1-d array, or Series
30
30
The argument which needs to be converted to timedelta.
31
- unit : Integer or float , default ns
31
+ unit : str , default 'ns'
32
32
Denotes the unit (D,h,m,s,ms,us,ns) of the arg.
33
- box : Boolean , default True
34
- If True returns a Timedelta/TimedeltaIndex of the results.
35
- if False returns a np.timedelta64 or ndarray of values of dtype
33
+ box : bool , default True
34
+ - If True returns a Timedelta/TimedeltaIndex of the results.
35
+ - if False returns a np.timedelta64 or ndarray of values of dtype
36
36
timedelta64[ns].
37
37
errors : {'ignore', 'raise', 'coerce'}, default 'raise'
38
- If 'raise', then invalid parsing will raise an exception.
39
- If 'coerce', then invalid parsing will be set as NaT.
40
- If 'ignore', then invalid parsing will return the input.
38
+ - If 'raise', then invalid parsing will raise an exception.
39
+ - If 'coerce', then invalid parsing will be set as NaT.
40
+ - If 'ignore', then invalid parsing will return the input.
41
41
42
42
Returns
43
43
-------
44
44
ret : timedelta64/arrays of timedelta64 if parsing succeeded
45
45
46
+ See Also
47
+ --------
48
+ DataFrame.astype : Cast argument to a specified dtype.
49
+ to_datetime : Convert argument to datetime.
50
+
46
51
Examples
47
52
--------
48
53
@@ -73,11 +78,6 @@ def to_timedelta(arg, unit='ns', box=True, errors='raise'):
73
78
74
79
>>> pd.to_timedelta(np.arange(5), box=False)
75
80
array([0, 1, 2, 3, 4], dtype='timedelta64[ns]')
76
-
77
- See also
78
- --------
79
- pandas.DataFrame.astype : Cast argument to a specified dtype.
80
- pandas.to_datetime : Convert argument to datetime.
81
81
"""
82
82
unit = _validate_timedelta_unit (unit )
83
83
0 commit comments