📅  最后修改于: 2022-03-11 14:45:14.259000             🧑  作者: Mango
def extract_data(filename):
infile = open(filename, 'r')
infile.readline() # skip the first line
data = [line.split() for line in infile]
annual_avg = data[-1][1]
data = [(m, float(r)) for m, r in data[:-1]]
infile.close()
return data, annual_avg