python valueerror:使用numpy解压缩的值太多

我想从一个Excel文件提取信息到Python,但我得到这个错误:

Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> main() File "C:\Users\viral\Desktop\python\test.py", line 5, in main date, time, temp = np.loadtxt('temperatures.csv', delimiter = ',', unpack = True, dtype = 'str') ValueError: too many values to unpack 

码:

 import numpy as np def main(): date, time, temp = np.loadtxt('temperature.csv', delimiter = ',', unpack = True, dtype = 'str') import itertools groups = itertools.groupby(zip(date, temp), lambda dv:dv[0]) list_of_lists = [[d] + [v[1] for v in values] for d, values in groups] list_of_lists = list_of_lists[:len(list_of_lists)-1] x = 0 while (x < len(list_of_lists)): list_of_lists[x] = [float(i) for i in list_of_lists[x]] print list_of_lists[x] x += 1 print len(list_of_lists) 

excel文件看起来像这样。 它是在CSV格式:

在这里输入图像说明

请帮助debugging

来自csv文件的原始数据:

 20130102 9:30:00 AM 34.75 20130102 9:31:00 AM 34.66 20130102 9:32:00 AM 34.6 20130102 9:33:00 AM 34.6 20130102 9:34:00 AM 34.61 20130102 9:35:00 AM 34.65 20130102 9:36:00 AM 34.65 

它继续65,208行

没关系。 我想到了。 有太多的行解开。 当我把csv文件分成两个大约30k行的文件时,它就起作用了