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 8e10d1b commit 5c8efc9Copy full SHA for 5c8efc9
examples/pylab_examples/load_converter.py
@@ -3,18 +3,7 @@
3
import matplotlib.pyplot as plt
4
import matplotlib.cbook as cbook
5
import matplotlib.dates as mdates
6
-
7
8
-# Note: matplotlib.dates doesn't have bytespdate2num.
9
-# This function was copied off the internet.
10
-# Source: http://pythonprogramming.net/colors-fills-matplotlib-tutorial/
11
-def bytespdate2num(fmt, encoding='utf-8'):
12
- strconverter = mdates.strpdate2num(fmt)
13
14
- def bytesconverter(b):
15
- s = b.decode(encoding)
16
- return strconverter(s)
17
- return bytesconverter
+from matplotlib.dates import bytespdate2num
18
19
datafile = cbook.get_sample_data('msft.csv', asfileobj=False)
20
print('loading', datafile)
0 commit comments