We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2e68ff commit 16ac8b7Copy full SHA for 16ac8b7
lib/matplotlib/dates.py
@@ -430,6 +430,10 @@ def date2num(d):
430
For details see the module docstring.
431
"""
432
433
+ if hasattr(d, "values"):
434
+ # this unpacks pandas datetime objects...
435
+ d = d.values
436
+
437
if ((isinstance(d, np.ndarray) and np.issubdtype(d.dtype, np.datetime64))
438
or isinstance(d, np.datetime64)):
439
return _dt64_to_ordinalf(d)
lib/matplotlib/units.py
@@ -154,6 +154,10 @@ def get_converter(self, x):
154
# DISABLED cached = self._cached.get(idx)
155
# DISABLED if cached is not None: return cached
156
157
+ if hasattr(x, "values"):
158
159
+ x = x.values
160
161
converter = None
162
classx = getattr(x, '__class__', None)
163
0 commit comments