Skip to content

Commit 3948d2e

Browse files
authored
DOC: updated date_format description for read_csv (#54705)
updated date_format description
1 parent febc1bd commit 3948d2e

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

pandas/io/parsers/readers.py

+14-5
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,20 @@
280280
Use ``date_format`` instead, or read in as ``object`` and then apply
281281
:func:`~pandas.to_datetime` as-needed.
282282
date_format : str or dict of column -> format, optional
283-
Format to use for parsing dates when used in conjunction with ``parse_dates``.
284-
For anything more complex, please read in as ``object`` and then apply
285-
:func:`~pandas.to_datetime` as-needed.
286-
287-
.. versionadded:: 2.0.0
283+
Format to use for parsing dates when used in conjunction with ``parse_dates``.
284+
The strftime to parse time, e.g. :const:`"%d/%m/%Y"`. See
285+
`strftime documentation
286+
<https://docs.python.org/3/library/datetime.html
287+
#strftime-and-strptime-behavior>`_ for more information on choices, though
288+
note that :const:`"%f"` will parse all the way up to nanoseconds.
289+
You can also pass:
290+
291+
- "ISO8601", to parse any `ISO8601 <https://en.wikipedia.org/wiki/ISO_8601>`_
292+
time string (not necessarily in exactly the same format);
293+
- "mixed", to infer the format for each element individually. This is risky,
294+
and you should probably use it along with `dayfirst`.
295+
296+
.. versionadded:: 2.0.0
288297
dayfirst : bool, default False
289298
DD/MM format dates, international and European format.
290299
cache_dates : bool, default True

0 commit comments

Comments
 (0)