summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorStefan van der Walt <sjvdwalt@gmail.com>2018-10-30 16:13:00 -0700
committerGitHub <noreply@github.com>2018-10-30 16:13:00 -0700
commit7cb9edfbb254504847fdf15861df56b0a4763cf6 (patch)
treef5a08fef694d273faf9a0d42e6c53f935eb56cc1 /doc
parentd2476fff1b22d96f6690650af6e52fae663f7413 (diff)
parentc9a6b02c347960f016ef28088ca8c63e0f2fe2f5 (diff)
downloadnumpy-7cb9edfbb254504847fdf15861df56b0a4763cf6.tar.gz
Merge pull request #12120 from tylerjereddy/remainder_timedelta64
ENH: add timedelta modulus operator support (mm)
Diffstat (limited to 'doc')
-rw-r--r--doc/release/1.16.0-notes.rst6
-rw-r--r--doc/source/reference/arrays.datetime.rst3
2 files changed, 9 insertions, 0 deletions
diff --git a/doc/release/1.16.0-notes.rst b/doc/release/1.16.0-notes.rst
index 3f2d887fe..89a4623e1 100644
--- a/doc/release/1.16.0-notes.rst
+++ b/doc/release/1.16.0-notes.rst
@@ -113,6 +113,12 @@ New Features
New keyword ``max_rows`` in `numpy.loadtxt` sets the maximum rows of the
content to be read after ``skiprows``, as in `numpy.genfromtxt`.
+modulus operator support added for ``np.timedelta64`` operands
+--------------------------------------------------------------
+The modulus (remainder) operator is now supported for two operands
+of type ``np.timedelta64``. The operands may have different units
+and the return value will match the type of the operands.
+
Improvements
============
diff --git a/doc/source/reference/arrays.datetime.rst b/doc/source/reference/arrays.datetime.rst
index e64d0c17e..387515f59 100644
--- a/doc/source/reference/arrays.datetime.rst
+++ b/doc/source/reference/arrays.datetime.rst
@@ -119,6 +119,9 @@ simple datetime calculations.
>>> np.timedelta64(1,'W') / np.timedelta64(1,'D')
7.0
+ >>> np.timedelta64(1,'W') % np.timedelta64(10,'D')
+ numpy.timedelta64(7,'D')
+
There are two Timedelta units ('Y', years and 'M', months) which are treated
specially, because how much time they represent changes depending
on when they are used. While a timedelta day unit is equivalent to