我想加载一个具有以下格式的 txt:
20-Sep-13,178.90,185.83,178.56,183.39,13401689
19-Sep-13,170.80,180.47,169.08,177.92,15594568
18-Sep-13,167.07,167.45,164.20,166.22,5439615
17-Sep-13,165.08,168.42,163.36,166.23,5500719
因此,我使用以下 Python 行:
date, closep, highp, lowp, openp, volume = np.loadtxt(stockFile, delimiter=',', unpack=True, converters={0: mdates.strpdate2num('%d-%b-%y')})
但我收到以下错误:
failed main loop time data '\xef\xbb\xbf20-Sep-13' does not match format '%d-%b-%y'
有谁知道,我做错了什么?
谢谢,麦基