summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTyler Reddy <tyler.je.reddy@gmail.com>2018-10-15 10:24:24 -0700
committerTyler Reddy <tyler.je.reddy@gmail.com>2018-10-15 10:24:24 -0700
commitc9a6b02c347960f016ef28088ca8c63e0f2fe2f5 (patch)
tree4f0ff588d0b4b759065c953bdeaccb6655d4f3b0 /doc
parent86ebcffb482afb67c2f6ec4f396d9017ea610bf1 (diff)
downloadnumpy-c9a6b02c347960f016ef28088ca8c63e0f2fe2f5.tar.gz
ENH: add timedelta modulus
* added support for modulus operator with timedelta operands; type signature is mm->m
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 f463ff28c..6b82a426f 100644
--- a/doc/release/1.16.0-notes.rst
+++ b/doc/release/1.16.0-notes.rst
@@ -100,6 +100,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