python 第九课 python的高阶应用对数据的处理
import csv
filename = 'sitka_weather_07-2014.csv'
with open(filename) as f:
reader = csv.reader(f)
header_row = next(reader)
print(header_row)
with open(filename) as f:
reader = csv.reader(f)
headr_row = next(reader)
for index, column_header in enumerate(header_row):
print(index, column_header)
#提取并读取数据 首先读取每天的最高气温:
with open(filename) as f:
reader = csv.reader(f)
header_row = next(reader)
highs = []
for row in reader:
highs.append(row[1])
print(highs)
文件文件下载地址 http://download.csdn.net/download/wang1018960145/10167710
接下来会有pythonweb开发文章