我有多个.dat文件,我正在尝试使用read_csv()将它们读入熊猫。它们以逗号分隔。除了一个文件(不是在逗号上分开并将所有数据都放在一列中)以外,所有文件都已正确读取。我迷失了为什么会发生这种情况,此文件与其他文件之间没有区别,我尝试了很多不同的参数。
这里是我所拥有的:
col_names=['faketime',"rn","counter","DepthCm","BattVolts","latdeg","latmin",
"Longdeg","Longmin","fq","ns","HDOP","altB","DepthVolts","LatDDDDD",
"LongDDDDD","month","day","hour","minute","second","year"]
mo = pd.read_csv(i, names=col_names, skiprows=4, sep=',')
这是文件的一部分
2015-05-08 07:17:56.7,7591,100001,0.11,12.46,81,37.6641,12,1.9694,1,11,0.7,-1.3,0.01,0.627735,0.03282334,5,8,7.000,17,56,20000
2015-05-08 07:17:59.54,7592,100002,0.06,12.45,81,37.6636,12,1.9702,1,11,0.7,-0.8,0.00,0.6277267,0.03283666,5,8,7.000,17,58,860000
2015-05-08 07:18:06.45,7593,100003,30.61,12.44,81,37.6633,12,1.9684,1,11,0.7,-0.6,2.008,0.6277217,0.03280667,5,8,7.000,18,5,770000