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 873addfCopy full SHA for 873addf
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
@@ -160,6 +160,10 @@ def get_converter(self, x):
160
if classx is not None:
161
converter = self.get(classx)
162
163
+ if hasattr(x, "values"):
164
165
+ x = x.values
166
167
# If x is an array, look inside the array for data with units
168
if isinstance(x, np.ndarray) and x.size:
169
xravel = x.ravel()
0 commit comments