We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9706db7 commit 10503e6Copy full SHA for 10503e6
lib/matplotlib/dates.py
@@ -283,7 +283,8 @@ def _dt64_to_ordinalf(d):
283
284
# the "extra" ensures that we at least allow the dynamic range out to
285
# seconds. That should get out to +/-2e11 years.
286
- extra = d - d.astype('datetime64[s]')
+ # NOTE: First cast truncates; second cast back is for NumPy 1.10.
287
+ extra = d - d.astype('datetime64[s]').astype(d.dtype)
288
extra = extra.astype('timedelta64[ns]')
289
t0 = np.datetime64('0001-01-01T00:00:00').astype('datetime64[s]')
290
dt = (d.astype('datetime64[s]') - t0).astype(np.float64)
0 commit comments