-
-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Milestone
Description
Reproducing code example:
import numpy as np
a = np.array(['1999-12-15', 'NaT'], dtype='M8[ns]')
np.isnan(a)
np.nanmin(a)
np.nanmax(a)Error message:
Each of those raises an:
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Background
Numpy 1.18 returns NaT for np.min(a) (it did skip NaT before 1.18; #14717). This breaks xarray (pydata/xarray#3409) and pandas (pandas-dev/pandas#29058) - therefore it would be good to make np.isnan work with datetime.
Numpy/Python version information:
1.18.0.dev0+3b5db53 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 21:52:21)
[GCC 7.3.0]
Metadata
Metadata
Assignees
Labels
No labels