From 9e2699793747e0205690b3e0149fa339ac42daa7 Mon Sep 17 00:00:00 2001 From: topper-123 Date: Fri, 11 Aug 2017 11:23:33 +0100 Subject: [PATCH] Add 'See also' sections (#17223) --- pandas/core/generic.py | 3 +++ pandas/core/tools/datetimes.py | 4 ++++ pandas/core/tools/numeric.py | 7 +++++++ pandas/core/tools/timedeltas.py | 5 +++++ 4 files changed, 19 insertions(+) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index bd3297f66a469..5a7f37bba91aa 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3681,6 +3681,9 @@ def astype(self, dtype, copy=True, errors='raise', **kwargs): See also -------- + pandas.to_datetime : Convert argument to datetime. + pandas.to_timedelta : Convert argument to timedelta. + pandas.to_numeric : Convert argument to a numeric type. numpy.ndarray.astype : Cast a numpy array to a specified type. """ if is_dict_like(dtype): diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index eebf78d7619eb..6ff4302937d07 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -335,6 +335,10 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False, 1 1960-01-03 2 1960-01-04 + See also + -------- + pandas.DataFrame.astype : Cast argument to a specified dtype. + pandas.to_timedelta : Convert argument to timedelta. """ from pandas.core.indexes.datetimes import DatetimeIndex diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index eda88a2f7e474..c584e29f682dd 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -84,6 +84,13 @@ def to_numeric(arg, errors='raise', downcast=None): 2 2.0 3 -3.0 dtype: float64 + + See also + -------- + pandas.DataFrame.astype : Cast argument to a specified dtype. + pandas.to_datetime : Convert argument to datetime. + pandas.to_timedelta : Convert argument to timedelta. + numpy.ndarray.astype : Cast a numpy array to a specified type. """ if downcast not in (None, 'integer', 'signed', 'unsigned', 'float'): raise ValueError('invalid downcasting method provided') diff --git a/pandas/core/tools/timedeltas.py b/pandas/core/tools/timedeltas.py index fe03f89fdb2c5..f2d99d26a87b8 100644 --- a/pandas/core/tools/timedeltas.py +++ b/pandas/core/tools/timedeltas.py @@ -61,6 +61,11 @@ def to_timedelta(arg, unit='ns', box=True, errors='raise'): >>> pd.to_timedelta(np.arange(5), unit='d') TimedeltaIndex(['0 days', '1 days', '2 days', '3 days', '4 days'], dtype='timedelta64[ns]', freq=None) + + See also + -------- + pandas.DataFrame.astype : Cast argument to a specified dtype. + pandas.to_datetime : Convert argument to datetime. """ unit = _validate_timedelta_unit(unit)