@@ -275,6 +275,14 @@ parse_dates : boolean or list of ints or names or list of lists or dict, default
275
275
infer_datetime_format : boolean, default ``False ``
276
276
If ``True `` and parse_dates is enabled for a column, attempt to infer the
277
277
datetime format to speed up the processing.
278
+
279
+ .. deprecated :: 1.5.2
280
+ ``infer_datetime_format `` be deprecated (as a strict version of it will become the default);
281
+ an easy workaround for non-strict parsing be clearly documented.
282
+
283
+ Currently, the only way to ensure consistent parsing is by explicitly passing
284
+ ``format= ``. The argument ``infer_datetime_format ``
285
+ isn't strict, can be called together with ``format ``, and can still break users' expectations:
278
286
keep_date_col : boolean, default ``False ``
279
287
If ``True `` and parse_dates specifies combining multiple columns then keep the
280
288
original columns.
@@ -916,12 +924,10 @@ an exception is raised, the next one is tried:
916
924
917
925
Note that performance-wise, you should try these methods of parsing dates in order:
918
926
919
- 1. Try to infer the format using ``infer_datetime_format=True `` (see section below).
920
-
921
- 2. If you know the format, use ``pd.to_datetime() ``:
927
+ 1. If you know the format, use ``pd.to_datetime() ``:
922
928
``date_parser=lambda x: pd.to_datetime(x, format=...) ``.
923
929
924
- 3 . If you have a really non-standard format, use a custom ``date_parser `` function.
930
+ 2 . If you have a really non-standard format, use a custom ``date_parser `` function.
925
931
For optimal performance, this should be vectorized, i.e., it should accept arrays
926
932
as arguments.
927
933
0 commit comments