File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -430,6 +430,10 @@ def date2num(d):
430430 For details see the module docstring.
431431 """
432432
433+ if hasattr (d , "values" ):
434+ # this unpacks pandas series or dataframes...
435+ d = d .values
436+
433437 if ((isinstance (d , np .ndarray ) and np .issubdtype (d .dtype , np .datetime64 ))
434438 or isinstance (d , np .datetime64 )):
435439 return _dt64_to_ordinalf (d )
Original file line number Diff line number Diff line change @@ -160,6 +160,10 @@ def get_converter(self, x):
160160 if classx is not None :
161161 converter = self .get (classx )
162162
163+ if converter is None and hasattr (x , "values" ):
164+ # this unpacks pandas series or dataframes...
165+ x = x .values
166+
163167 # If x is an array, look inside the array for data with units
164168 if isinstance (x , np .ndarray ) and x .size :
165169 xravel = x .ravel ()
You can’t perform that action at this time.
0 commit comments