python找不到csv文件_在python中读取没有标题行的csv文件

1586010002-jmsa.png

I need to read a tab delimited csv file without the 11 header lines as shown below. How can I do this in python?

START: 21.09.2011 11:24:12

TIME STEP:

100 = 10s

VOLTAGE RANGE:

CH1: 255 = 3V CH3: 255 = 30V

CH2: 255 = 30V CH4: 255 = 30V

N CH1 Time/s CH1/V CH2/V CH3/V CH4/V

0 137 0,00 1,612 0,000 0,000 0,000

1 137 0,10 1,612 0,000 0,000 0,000

2 137 0,20 1,612 0,000 0,000 0,000

3 131 0,30 1,541 0,000 0,000 0,000

...

Thanks a lot

Otto

解决方案import csv

import itertools

with open('1.csv') as f:

lines = itertools.islice(f, 11, None) # skip 11 lines, similar to [11:]

reader = csv.reader(lines)

for row in reader:

... Do whatever you want with row ..

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值