Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb0047a

Browse files
committed
BUG: avoid a deprecation warning from numpy 2.5 (calling datetime64('NaT') without a unit is deprecated)
1 parent 60383ac commit bb0047a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/matplotlib/dates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def _dt64_to_ordinalf(d):
325325
dt += extra.astype(np.float64) / 1.0e9
326326
dt = dt / SEC_PER_DAY
327327

328-
NaT_int = np.datetime64('NaT').astype(np.int64)
328+
NaT_int = np.datetime64('NaT', 's').astype(np.int64)
329329
d_int = d.astype(np.int64)
330330
dt[d_int == NaT_int] = np.nan
331331
return dt

0 commit comments

Comments
 (0)