Skip to content

Commit 57e16b2

Browse files
author
Chris Bertinato
committed
Recommend .to_numpy() in lieu of .values
1 parent 6499a67 commit 57e16b2

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
@@ -1259,7 +1259,7 @@ Deprecations
12591259
- :meth:`Series.nonzero` is deprecated and will be removed in a future version (:issue:`18262`)
12601260
- Passing an integer to :meth:`Series.fillna` and :meth:`DataFrame.fillna` with ``timedelta64[ns]`` dtypes is deprecated, will raise ``TypeError`` in a future version. Use ``obj.fillna(pd.Timedelta(...))`` instead (:issue:`24694`)
12611261
- ``Series.cat.categorical``, ``Series.cat.name`` and ``Sersies.cat.index`` have been deprecated. Use the attributes on ``Series.cat`` or ``Series`` directly. (:issue:`24751`).
1262-
- 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`).
1262+
- 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`).
12631263

12641264
.. _whatsnew_0240.deprecations.datetimelike_int_ops:
12651265

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
@@ -43,7 +43,7 @@ def to_timedelta(arg, unit='ns', box=True, errors='raise'):
4343
values of dtype timedelta64[ns].
4444
4545
.. deprecated:: 0.24.0
46-
Use :attr:`Series.values` or :meth:`Timedelta.to_timedelta64`
46+
Use :meth:`.to_numpy` or :meth:`Timedelta.to_timedelta64`
4747
instead to get an ndarray of values or numpy.timedelta64,
4848
respectively.
4949

0 commit comments

Comments
 (0)