Skip to content

Commit 5c8efc9

Browse files
committed
Removed custom bytespdate2num function.
I’m going to take it on faith that this works. In the short period of time here, I wasn’t able to get it working on my local system.
1 parent 8e10d1b commit 5c8efc9

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

examples/pylab_examples/load_converter.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,7 @@
33
import matplotlib.pyplot as plt
44
import matplotlib.cbook as cbook
55
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
6+
from matplotlib.dates import bytespdate2num
187

198
datafile = cbook.get_sample_data('msft.csv', asfileobj=False)
209
print('loading', datafile)

0 commit comments

Comments
 (0)