File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -436,6 +436,10 @@ def date2num(d):
436436 For details see the module docstring.
437437 """
438438
439+ if hasattr (d , "values" ):
440+ # this unpacks pandas series or dataframes...
441+ d = d .values
442+
439443 if ((isinstance (d , np .ndarray ) and np .issubdtype (d .dtype , np .datetime64 ))
440444 or isinstance (d , np .datetime64 )):
441445 return _dt64_to_ordinalf (d )
Original file line number Diff line number Diff line change @@ -156,6 +156,10 @@ def get_converter(self, x):
156156 if classx is not None :
157157 converter = self .get (classx )
158158
159+ if converter is None and hasattr (x , "values" ):
160+ # this unpacks pandas series or dataframes...
161+ x = x .values
162+
159163 # If x is an array, look inside the array for data with units
160164 if isinstance (x , np .ndarray ) and x .size :
161165 xravel = x .ravel ()
You can’t perform that action at this time.
0 commit comments