From 7eaef1ed5841c2e55db27bfe5afdc8146d1578db Mon Sep 17 00:00:00 2001 From: abatomunkuev Date: Tue, 12 Oct 2021 23:35:00 -0400 Subject: [PATCH 1/4] DOC: Added DataFrame in Parameters & Return description in the docstring --- pandas/core/tools/datetimes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index 8b37026e16171..eddc6de7c0bf9 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -692,7 +692,8 @@ def to_datetime( Parameters ---------- arg : int, float, str, datetime, list, tuple, 1-d array, Series, DataFrame/dict-like - The object to convert to a datetime. + The object to convert to a datetime. If the DataFrame is provided, the method expects + minimally the following columns ( "year", "month", "day") in the DataFrame. errors : {'ignore', 'raise', 'coerce'}, default 'raise' - If 'raise', then invalid parsing will raise an exception. - If 'coerce', then invalid parsing will be set as NaT. @@ -775,6 +776,7 @@ def to_datetime( - DatetimeIndex, if timezone naive or aware with the same timezone - Index of object dtype, if timezone aware with mixed time offsets - Series: Series of datetime64 dtype + - DataFrame: Series of datetime64 dtype - scalar: Timestamp In case when it is not possible to return designated types (e.g. when From e5158738198c9184da369f318491483e6c7e78cb Mon Sep 17 00:00:00 2001 From: abatomunkuev Date: Wed, 13 Oct 2021 00:29:28 -0400 Subject: [PATCH 2/4] DOC: Reduced number of characters in Line 695 --- pandas/core/tools/datetimes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index eddc6de7c0bf9..3a5ae7c072950 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -692,8 +692,9 @@ def to_datetime( Parameters ---------- arg : int, float, str, datetime, list, tuple, 1-d array, Series, DataFrame/dict-like - The object to convert to a datetime. If the DataFrame is provided, the method expects - minimally the following columns ( "year", "month", "day") in the DataFrame. + The object to convert to a datetime. If the DataFrame is provided, + the method expects minimally the following columns: "year", "month", "day" + in the DataFrame. errors : {'ignore', 'raise', 'coerce'}, default 'raise' - If 'raise', then invalid parsing will raise an exception. - If 'coerce', then invalid parsing will be set as NaT. From b5e029d4cf2f949b84a9e6deb93d5d0eb8b5990c Mon Sep 17 00:00:00 2001 From: abatomunkuev Date: Wed, 13 Oct 2021 00:33:43 -0400 Subject: [PATCH 3/4] DOC: removed trailing whitespaces --- pandas/core/tools/datetimes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index 3a5ae7c072950..9238b772e667e 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -692,8 +692,8 @@ def to_datetime( Parameters ---------- arg : int, float, str, datetime, list, tuple, 1-d array, Series, DataFrame/dict-like - The object to convert to a datetime. If the DataFrame is provided, - the method expects minimally the following columns: "year", "month", "day" + The object to convert to a datetime. If the DataFrame is provided,the method + expects minimally the following columns: "year", "month", "day" in the DataFrame. errors : {'ignore', 'raise', 'coerce'}, default 'raise' - If 'raise', then invalid parsing will raise an exception. From 9cedfd80b4be5bb0059885b155fc8beeeb6d114d Mon Sep 17 00:00:00 2001 From: abatomunkuev Date: Sat, 16 Oct 2021 22:09:55 -0400 Subject: [PATCH 4/4] DOC: Removed redundant text and fixed punctuation. --- pandas/core/tools/datetimes.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index 9238b772e667e..21357f37853d9 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -692,9 +692,8 @@ def to_datetime( Parameters ---------- arg : int, float, str, datetime, list, tuple, 1-d array, Series, DataFrame/dict-like - The object to convert to a datetime. If the DataFrame is provided,the method - expects minimally the following columns: "year", "month", "day" - in the DataFrame. + The object to convert to a datetime. If the DataFrame is provided, the method + expects minimally the following columns: "year", "month", "day". errors : {'ignore', 'raise', 'coerce'}, default 'raise' - If 'raise', then invalid parsing will raise an exception. - If 'coerce', then invalid parsing will be set as NaT.