Skip to content

Commit 7ed7c7a

Browse files
DOC: to_datetime param format has no effect for df (#54079)
* DOC: to_datetime param format has no effect for df * warning -> note --------- Co-authored-by: Marco Edward Gorelli <marcogorelli@protonmail.com>
1 parent 926403d commit 7ed7c7a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/core/tools/datetimes.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,8 @@ def to_datetime(
706706
arg : int, float, str, datetime, list, tuple, 1-d array, Series, DataFrame/dict-like
707707
The object to convert to a datetime. If a :class:`DataFrame` is provided, the
708708
method expects minimally the following columns: :const:`"year"`,
709-
:const:`"month"`, :const:`"day"`.
709+
:const:`"month"`, :const:`"day"`. The column "year"
710+
must be specified in 4-digit format.
710711
errors : {'ignore', 'raise', 'coerce'}, default 'raise'
711712
- If :const:`'raise'`, then invalid parsing will raise an exception.
712713
- If :const:`'coerce'`, then invalid parsing will be set as :const:`NaT`.
@@ -765,6 +766,11 @@ def to_datetime(
765766
time string (not necessarily in exactly the same format);
766767
- "mixed", to infer the format for each element individually. This is risky,
767768
and you should probably use it along with `dayfirst`.
769+
770+
.. note::
771+
772+
If a :class:`DataFrame` is passed, then `format` has no effect.
773+
768774
exact : bool, default True
769775
Control how `format` is used:
770776

0 commit comments

Comments
 (0)