"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# box plot for Alonso/Fernando of points- median seems to equal 75th percentile for hamilton\n",
"ham_2007_pts = ham_2007[['race', 'dname', 'points']].copy()\n",
"fig = px.box(ham_2007_pts, y='dname', x='points', color='dname',\n",
" color_discrete_map={'Fernando Alonso': '#1C8356', 'Lewis Hamilton': '#2E91E5'},\n",
" labels={'dname': 'Driver', 'points': 'Points'}, title='Distribution of Points (2007 Season)')\n",
"fig.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"These distributions highlight that:\n",
" - The two McLaren drivers scored the same number of points but Hamilton's median points were higher than Alonso's.\n",
" - Hamilton frequently scored on the higher end of the points spectrum but had a few races where he scored a limited number of points, dragging his average points down. This is evident by the left skew of his box plot\n",
" - Alonso's box plot tells the opposite story. While his skewness is less extreme than Hamilton's, it still indicates that Alonso repeatedly scored on the lower end of the points spectrum. Yet he still had a few races where he amassed a large number of points.\n",
"\n",
"In conclusion, we derive similar insights here as we did in the finishing position comparison since the two go hand in hand. __Hamilton barely beats Alonso__ in this criterion too."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 7. Putting it All Together"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Putting all the metrics together, we can sum up what we found as the following:\n",
"\n",
"\n",
"- Grid positioning: __Hamilton__ is the favorite in this category.\n",
"\n",
"\n",
"- Driving positioning lap-to-lap: __Hamilton__ achieves favorable positioning on a given lap.\n",
"\n",
"- Finishing positions: Alonso finishes ahead of Hamilton more often. However, __Hamilton__ is superior where it counts most, podium placement. The difference in 2nd place finishes actually resulted in Hamilton finishing second and Alonso third in the drivers standing for the 2007 season.\n",
"\n",
"\n",
"- Points: Alonso has more races with more points but __Hamilton__ has more favorable statistics.\n",
"\n",
"\n",
"- Final Comparison:\n",
" - Lewis Hamilton: ranks higher in __4__ of the metrics we looked at.\n",
" - Fernando Alonso: ranks higher in __0__ of the metrics we looked at.\n",
" \n",
"__Overall:__ __Hamilton__ was the better driver in the 2007 season although they were very well-matched. This is is especially impressive since this was his rookie season while Alonso had a few years of experience under his belt. \n",
"\n",
"While Hamilton was victorious in each metric, it was a very evenly-matched comparison. Both drivers performed at a very high caliber and finished in the top 3 drivers standings for the 2007 season. Furthermore, as a team they completely dominated the charts as the only other team besides McLaren to win any races was Ferrari. It would be interesting to compare them again further down the line if they ever became teammates again. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 8. References"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. [2007 French Grand Prix](https://en.wikipedia.org/wiki/2007_French_Grand_Prix)\n",
"2. [2007 Hungarian Grand Prix](https://en.wikipedia.org/wiki/2007_Hungarian_Grand_Prix)\n",
"3. [2007 Chinese Grand Prix](https://en.wikipedia.org/wiki/2007_Chinese_Grand_Prix)\n",
"4. [2007 Canadian Grand Prix](https://en.wikipedia.org/wiki/2007_Canadian_Grand_Prix)\n",
"5. [2007 European Grand Prix](https://en.wikipedia.org/wiki/2007_European_Grand_Prix)\n",
"6. [2007 Japanese Grand Prix](https://en.wikipedia.org/wiki/2007_Japanese_Grand_Prix)\n",
"7. [2007 Brazilian Grand Prix](https://en.wikipedia.org/wiki/2007_Brazilian_Grand_Prix)\n",
"8. [2007 Formula 1 World Championship](https://en.wikipedia.org/wiki/2007_Formula_One_World_Championship)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": false,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": true,
"toc_position": {
"height": "calc(100% - 180px)",
"left": "10px",
"top": "150px",
"width": "384px"
},
"toc_section_display": true,
"toc_window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 2
}