In a csv file I have data representing the date, open, close, high, low, and volume for a particular stock. The data is stored in the following format:
20150601 000000;1.094990;1.095010;1.094990;1.094990;0
I am attempting to use the following code to extract the date into a numpy array so i can analyze the data using algorithms. However, when converting the date I do not get the correct date.
Can anyone identify the error that I am making?
datefunc = lambda x: mdates.date2num(datetime.strptime(x, '%y%m%d%H%M %f'))
date,high,low,open,close,volume = np.loadtxt('DAT_ASCII_EURUSD_M1_201506.csv',unpack=True,
delimiter=';',
converters={0:datefunc})
Any help is much appreciated.
mdates.date2num?import matplotlib.dates as mdates.'%Y%m%d'but you cannot have datetimes and floats in the same array. I think pandas would be pretty useful