notebooks
notebooks copied to clipboard
Add pre-1991 scoring system to formula one notebook
Notebook
Formula one notebook
Description
Perform topcount aggregation for past 1991 scores
Previous code for backup:
# index = race year, 1 column for each position, values are the number of points scored for the race position
scoring_columns = np.arange(1, 41)
scoring_index = (
"sc1950to1959fl sc1960 sc1961to1990 sc1991to2002 sc2003to2009 sc2010to2013 sc2014lr sc2015to2018 sc2019fl"
).split()
dfscoring = pd.DataFrame(0, index=scoring_index, columns=scoring_columns)
# before 1991, the calculation rule is not a simple aggregation given that only the Nth best race results were retained...
# dfscoring.loc['sc1950to1959fl'][1,2,3,4,5] = [8,6,4,3,2] #fastest lap bonus +1 point
# dfscoring.loc['sc1960'][1,2,3,4,5,6] = [8,6,4,3,2,1]
# dfscoring.loc['sc1961to1990'][1,2,3,4,5,6] = [9,6,4,3,2,1]
dfscoring.loc["sc1991to2002"][1, 2, 3, 4, 5, 6] = [10, 6, 4, 3, 2, 1]
dfscoring.loc["sc2003to2009"][1, 2, 3, 4, 5, 6, 7, 8] = [10, 8, 6, 5, 4, 3, 2, 1]
dfscoring.loc["sc2010to2013"][1, 2, 3, 4, 5, 6, 7, 8, 9, 10] = [
25,
18,
15,
12,
10,
8,
6,
4,
2,
1,
]
# dfscoring.loc['sc2014lr'][1,2,3,4,5,6,7,8,9,10] = [25,18,15,12,10,8,6,4,2,1] #last race bonus double points
dfscoring.loc["sc2015to2018"] = dfscoring.loc["sc2010to2013"]
# dfscoring.loc['sc2019fl'] = dfscoring.loc['sc2010to2013'] #fastest lap bonus +1 point