You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes GH8865 (Timestamp - Timestamp -> Timedelta)
This PR cleans up and extends `Timestamp` arithmetic similarly to the
treatment for `Timedelta` in GH8884.
It includes a new `to_datetime64()` method, and arithmetic now works between
Timestamp and ndarrays. I also ensured comparison operations work properly
between all of (Timestamp, Timedelta, NaT) and ndarrays.
Implementation notes: wide use of the `NotImplemented` singleton let me
cleanup many of these complex cases. I also strove to reduce the tight-
coupling of `Timestamp`/`Timedelta` to pandas itself by removing use of the
`_typ` property in tslib (I honestly don't quite understand why it needs to
exist) and by not treating series/index any differently from any other
ndarray-like object.
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.15.2.txt
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -66,9 +66,9 @@ Enhancements
66
66
- Added support for ``utcfromtimestamp()``, ``fromtimestamp()``, and ``combine()`` on `Timestamp` class (:issue:`5351`).
67
67
- Added Google Analytics (`pandas.io.ga`) basic documentation (:issue:`8835`). See :ref:`here<remote_data.ga>`.
68
68
- Added flag ``order_categoricals`` to ``StataReader`` and ``read_stata`` to select whether to order imported categorical data (:issue:`8836`). See :ref:`here <io.stata-categorical>` for more information on importing categorical variables from Stata data files.
69
-
- ``Timedelta`` arithmetic returns ``NotImplemented`` in unknown cases, allowing extensions by custom classes (:issue:`8813`).
70
-
- ``Timedelta`` now supports arithemtic with ``numpy.ndarray`` objects of the appropriate dtype (numpy 1.8 or newer only) (:issue:`8884`).
71
-
- Added ``Timedelta.to_timedelta64`` method to the public API (:issue:`8884`).
69
+
- ``Timestamp`` and ``Timedelta`` arithmetic and comparisons return ``NotImplemented`` in unknown cases, allowing extensions by custom classes (:issue:`8813`, :issue:`TBD`).
70
+
- ``Timestamp`` and ``Timedelta`` now support arithmetic and comparisons with ``numpy.ndarray`` objects of the appropriate dtype (numpy 1.8 or newer only) (:issue:`8884`, :issue:`TBD`).
71
+
- Added ``Timestamp.to_datetime64`` and ``Timedelta.to_timedelta64`` methods to the public API (:issue:`8884`, :issue:`TBD`).
72
72
73
73
.. _whatsnew_0152.performance:
74
74
@@ -93,6 +93,7 @@ Bug Fixes
93
93
- ``io.data.Options`` now raises ``RemoteDataError`` when no expiry dates are available from Yahoo (:issue:`8761`).
94
94
- ``Timedelta`` kwargs may now be numpy ints and floats (:issue:`8757`).
95
95
- Fixed several outstanding bugs for ``Timedelta`` arithmetic and comparisons (:issue:`8813`, :issue:`5963`, :issue:`5436`).
96
+
- The difference of two ``Timestamp`` objects is now a ``pandas.Timedelta`` rather than only a ``datetime.timedelta`` (:issue:`8865`).
96
97
- ``sql_schema`` now generates dialect appropriate ``CREATE TABLE`` statements (:issue:`8697`)
97
98
- ``slice`` string method now takes step into account (:issue:`8754`)
98
99
- Bug in ``BlockManager`` where setting values with different type would break block integrity (:issue:`8850`)
0 commit comments