Skip to content

Commit

Permalink
added a validating condition which would not typecast the 'datetime64…
Browse files Browse the repository at this point in the history
…' data type
  • Loading branch information
Dinkarkumar committed Aug 30, 2021
1 parent 5350aa0 commit 4b0a9e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numpy/core/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -2345,7 +2345,7 @@ def within_tol(x, y, atol, rtol):
# possibly be deprecated. See also gh-18286.
# timedelta works if `atol` is an integer or also a timedelta.
# Although, the default tolerances are unlikely to be useful
if y.dtype.kind != "m":
if y.dtype.kind != "m" and x.dtype.kind != "M" and y.dtype.kind != "M":
dt = multiarray.result_type(y, 1.)
y = asanyarray(y, dtype=dt)

Expand Down

0 comments on commit 4b0a9e1

Please sign in to comment.