summaryrefslogtreecommitdiff
path: root/podiums.py
blob: 36eaaa55d9dd85a91deef8c31f97913d0dfcf87f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import csv

output = csv.writer(open('charts/podium-averages.csv', 'w'))

output.writerow(['race','podium_sum','podium_sum_after','grid_average','average_change','podium_to_average','podium_to_average_per_driver','average_change_to_grid_average'])

for line in csv.reader(open('charts/rate.csv')):
    name = '-'.join(line[:-4])
    values = map(float, line[-4:])
    values.append(values[0] / values[2])
    values.append(values[4] / 3)
    values.append(values[3] / values[2] * 100)
    values[:0] = [name]
    output.writerow(values)