From 36b781872df65dc702bf5a262ac97cec76d41952 Mon Sep 17 00:00:00 2001 From: Scott Lasley Date: Wed, 24 Jun 2020 18:24:53 -0400 Subject: [PATCH 1/3] DOC: Add notes about M and Y to to_timedelata documentation. (#34968) --- pandas/core/tools/timedeltas.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandas/core/tools/timedeltas.py b/pandas/core/tools/timedeltas.py index a643c312ec358..40ca918eb5d36 100644 --- a/pandas/core/tools/timedeltas.py +++ b/pandas/core/tools/timedeltas.py @@ -25,7 +25,10 @@ def to_timedelta(arg, unit=None, errors="raise"): Parameters ---------- arg : str, timedelta, list-like or Series - The data to be converted to timedelta. + The data to be converted to timedelta. Note that the character M + is treated as minute, not month. The characters Y and y are treated + as the mean length of the Gregorian calendar year - 365.2425 days or + 365 days 5 hours 49 minutes 12 seconds unit : str, optional Denotes the unit of the arg for numeric `arg`. Defaults to ``"ns"``. From f31dfabdcc2a4fb9ef54dc7eecd5b2be5eb3a43f Mon Sep 17 00:00:00 2001 From: Scott Lasley Date: Tue, 1 Sep 2020 11:58:11 -0400 Subject: [PATCH 2/3] DOC: Update notes about M and Y to to_timedelata documentation. (#34968) --- pandas/core/tools/timedeltas.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/tools/timedeltas.py b/pandas/core/tools/timedeltas.py index 40ca918eb5d36..656ec91a80938 100644 --- a/pandas/core/tools/timedeltas.py +++ b/pandas/core/tools/timedeltas.py @@ -25,10 +25,10 @@ def to_timedelta(arg, unit=None, errors="raise"): Parameters ---------- arg : str, timedelta, list-like or Series - The data to be converted to timedelta. Note that the character M - is treated as minute, not month. The characters Y and y are treated - as the mean length of the Gregorian calendar year - 365.2425 days or - 365 days 5 hours 49 minutes 12 seconds + The data to be converted to timedelta. The character M by itself, + e.g. '1M', is treated as minute, not month. The characters Y and y + are treated as the mean length of the Gregorian calendar year - + 365.2425 days or 365 days 5 hours 49 minutes 12 seconds. unit : str, optional Denotes the unit of the arg for numeric `arg`. Defaults to ``"ns"``. From a9ddaf6c3c596ff31adc8a13edb2b175b96c5a4d Mon Sep 17 00:00:00 2001 From: Scott Lasley Date: Tue, 1 Sep 2020 12:04:40 -0400 Subject: [PATCH 3/3] DOC: Add notes about M and Y to to_timedelata documentation. (#34968) --- pandas/core/tools/timedeltas.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/tools/timedeltas.py b/pandas/core/tools/timedeltas.py index 656ec91a80938..c34fe8d298cb9 100644 --- a/pandas/core/tools/timedeltas.py +++ b/pandas/core/tools/timedeltas.py @@ -25,9 +25,9 @@ def to_timedelta(arg, unit=None, errors="raise"): Parameters ---------- arg : str, timedelta, list-like or Series - The data to be converted to timedelta. The character M by itself, - e.g. '1M', is treated as minute, not month. The characters Y and y - are treated as the mean length of the Gregorian calendar year - + The data to be converted to timedelta. The character M by itself, + e.g. '1M', is treated as minute, not month. The characters Y and y + are treated as the mean length of the Gregorian calendar year - 365.2425 days or 365 days 5 hours 49 minutes 12 seconds. unit : str, optional Denotes the unit of the arg for numeric `arg`. Defaults to ``"ns"``.