【发布时间】:2019-10-18 20:09:03
【问题描述】:
如何在 Pandas DataFrame 中跳过列标题行
我的代码:
sample = pd.DataFrame(pd.read_csv('Fremont TMY_Sample_Original.csv', `Import csv`low_memory=False))
sample_header = sample.iloc[:1, 0:20] `Wants to separate first two row because these are different data at start `
sample2 = sample[sample.iloc[:, 0:16] `wants to take required data for next process`
sample2 = ('sample2', (header=False)) `Trying to skip column title row`
print(sample2)
预期输出:
举个例子
全年数据(此行我想删除并保留我想保留的行)
Date Time(Hour) WindSpeed(m/s)
0 5 1 10
1 4 2 17
2 6 3 16
3 7 4 11
【问题讨论】:
-
请展示您的数据框和预期输出的示例