Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2e68ff commit cecf1f5Copy full SHA for cecf1f5
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 series or dataframes...
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