File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -252,18 +252,15 @@ def _dt64_to_ordinalf(d):
252
252
because we do times compared to ``0001-01-01T00:00:00`` (plus one day).
253
253
"""
254
254
255
- zerod = False
256
- if isinstance (d , np .datetime64 ):
257
- zerod = True
258
- d = np .atleast_1d (d )
255
+ # the "extra" ensures that we at least allow the dynamic range out to
256
+ # seconds. That should get out to +/-2e11 years.
259
257
extra = d - d .astype ('datetime64[s]' )
260
258
extra = extra .astype ('timedelta64[ns]' )
261
259
t0 = np .datetime64 ('0001-01-01T00:00:00' ).astype ('datetime64[s]' )
262
260
dt = (d .astype ('datetime64[s]' ) - t0 ).astype (np .float64 )
263
261
dt += extra .astype (np .float64 ) / 1.0e9
264
262
dt = dt / SEC_PER_DAY + 1.0
265
- if zerod :
266
- dt = dt [0 ]
263
+
267
264
return dt
268
265
269
266
You can’t perform that action at this time.
0 commit comments