|
20 | 20 | from pandas import compat
|
21 | 21 | from pandas.core import algorithms
|
22 | 22 |
|
| 23 | +from pandas.util._decorators import deprecate_kwarg |
| 24 | + |
23 | 25 |
|
24 | 26 | def _guess_datetime_format_for_array(arr, **kwargs):
|
25 | 27 | # Try to guess the format based on the first non-NaN element
|
@@ -388,6 +390,7 @@ def _adjust_to_origin(arg, origin, unit):
|
388 | 390 | return arg
|
389 | 391 |
|
390 | 392 |
|
| 393 | +@deprecate_kwarg(old_arg_name='box', new_arg_name=None) |
391 | 394 | def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
|
392 | 395 | utc=None, box=True, format=None, exact=True,
|
393 | 396 | unit=None, infer_datetime_format=False, origin='unix',
|
@@ -434,6 +437,12 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
|
434 | 437 |
|
435 | 438 | - If True returns a DatetimeIndex or Index-like object
|
436 | 439 | - If False returns ndarray of values.
|
| 440 | +
|
| 441 | + .. deprecated:: 0.24.0 |
| 442 | + Use :attr:`Series.values` or :meth:`Timestamp.to_datetime64` |
| 443 | + instead to get an ndarray of values or numpy.datetime64, |
| 444 | + respectively. |
| 445 | +
|
437 | 446 | format : string, default None
|
438 | 447 | strftime to parse time, eg "%d/%m/%Y", note that "%f" will parse
|
439 | 448 | all the way up to nanoseconds.
|
|
0 commit comments