In my current project I want to read some experimental data from a text file into Python using the following code:
import numpy as np
from matplotlib.dates i
Here is a workaround:
import numpy as np
import matplotlib.dates as mdates
def bytedate2num(fmt):
def converter(b):
return mdates.strpdate2num(fmt)(b.decode('ascii'))
return converter
date_converter = bytedate2num("%d.%m.%Y %H:%M:%S")
data = np.recfromtxt('example.txt',
comments='#',
delimiter=';',
names=('time', 't_ref', 't_s', 't_amb1', 't_amb2', 't_amb3'),
converters={'time': date_converter})