File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -436,6 +436,10 @@ def date2num(d):
436
436
For details see the module docstring.
437
437
"""
438
438
439
+ if hasattr (d , "values" ):
440
+ # this unpacks pandas series or dataframes...
441
+ d = d .values
442
+
439
443
if ((isinstance (d , np .ndarray ) and np .issubdtype (d .dtype , np .datetime64 ))
440
444
or isinstance (d , np .datetime64 )):
441
445
return _dt64_to_ordinalf (d )
Original file line number Diff line number Diff line change @@ -156,6 +156,10 @@ def get_converter(self, x):
156
156
if classx is not None :
157
157
converter = self .get (classx )
158
158
159
+ if converter is None and hasattr (x , "values" ):
160
+ # this unpacks pandas series or dataframes...
161
+ x = x .values
162
+
159
163
# If x is an array, look inside the array for data with units
160
164
if isinstance (x , np .ndarray ) and x .size :
161
165
xravel = x .ravel ()
You can’t perform that action at this time.
0 commit comments