diff options
author | Stefan van der Walt <sjvdwalt@gmail.com> | 2018-10-30 16:13:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 16:13:00 -0700 |
commit | 7cb9edfbb254504847fdf15861df56b0a4763cf6 (patch) | |
tree | f5a08fef694d273faf9a0d42e6c53f935eb56cc1 /doc | |
parent | d2476fff1b22d96f6690650af6e52fae663f7413 (diff) | |
parent | c9a6b02c347960f016ef28088ca8c63e0f2fe2f5 (diff) | |
download | numpy-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.rst | 6 | ||||
-rw-r--r-- | doc/source/reference/arrays.datetime.rst | 3 |
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 |