File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -430,6 +430,10 @@ def date2num(d):
430
430
For details see the module docstring.
431
431
"""
432
432
433
+ if hasattr (d , "values" ):
434
+ # this unpacks pandas datetime objects...
435
+ d = d .values
436
+
433
437
if ((isinstance (d , np .ndarray ) and np .issubdtype (d .dtype , np .datetime64 ))
434
438
or isinstance (d , np .datetime64 )):
435
439
return _dt64_to_ordinalf (d )
Original file line number Diff line number Diff line change @@ -154,6 +154,10 @@ def get_converter(self, x):
154
154
# DISABLED cached = self._cached.get(idx)
155
155
# DISABLED if cached is not None: return cached
156
156
157
+ if hasattr (x , "values" ):
158
+ # this unpacks pandas datetime objects...
159
+ x = x .values
160
+
157
161
converter = None
158
162
classx = getattr (x , '__class__' , None )
159
163
You can’t perform that action at this time.
0 commit comments