Skip to content

Commit 5b84d9c

Browse files
author
Chris Bertinato
committed
Recommend .to_numpy() in lieu of .values
1 parent a4f3d97 commit 5b84d9c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

doc/source/whatsnew/v0.24.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ Deprecations
11521152
- Passing a string alias like ``'datetime64[ns, UTC]'`` as the ``unit`` parameter to :class:`DatetimeTZDtype` is deprecated. Use :class:`DatetimeTZDtype.construct_from_string` instead (:issue:`23990`).
11531153
- In :meth:`Series.where` with Categorical data, providing an ``other`` that is not present in the categories is deprecated. Convert the categorical to a different dtype or add the ``other`` to the categories first (:issue:`24077`).
11541154
- :meth:`Series.clip_lower`, :meth:`Series.clip_upper`, :meth:`DataFrame.clip_lower` and :meth:`DataFrame.clip_upper` are deprecated and will be removed in a future version. Use ``Series.clip(lower=threshold)``, ``Series.clip(upper=threshold)`` and the equivalent ``DataFrame`` methods (:issue:`24203`)
1155-
- The functions :func:`pandas.to_datetime` and :func:`pandas.to_timedelta` have deprecated the ``box`` keyword. Use :attr:`Series.values` and :meth:`Timestamp.to_datetime64`/:meth:`Timedelta.to_timedelta64` instead to get an ndarray of values or ``numpy.timestamp64``/``numpy.timedelta64``, respectively (:issue:`24416`).
1155+
- The functions :func:`pandas.to_datetime` and :func:`pandas.to_timedelta` have deprecated the ``box`` keyword. Use :meth:`.to_numpy` and :meth:`Timestamp.to_datetime64`/:meth:`Timedelta.to_timedelta64` instead to get an ndarray of values or ``numpy.datetime64``/``numpy.timedelta64``, respectively (:issue:`24416`).
11561156

11571157
.. _whatsnew_0240.deprecations.datetimelike_int_ops:
11581158

pandas/core/tools/datetimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
439439
- If False returns ndarray of values.
440440
441441
.. deprecated:: 0.24.0
442-
Use :attr:`Series.values` or :meth:`Timestamp.to_datetime64`
442+
Use :meth:`.to_numpy` or :meth:`Timestamp.to_datetime64`
443443
instead to get an ndarray of values or numpy.datetime64,
444444
respectively.
445445

pandas/core/tools/timedeltas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def to_timedelta(arg, unit='ns', box=True, errors='raise'):
4545
values of dtype timedelta64[ns].
4646
4747
.. deprecated:: 0.24.0
48-
Use :attr:`Series.values` or :meth:`Timedelta.to_timedelta64`
48+
Use :meth:`.to_numpy` or :meth:`Timedelta.to_timedelta64`
4949
instead to get an ndarray of values or numpy.timedelta64,
5050
respectively.
5151

0 commit comments

Comments
 (0)