juliasabatel / F1_Project

Analysis of the 2021 season of formula 1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

F1_Project

ABOUT

🇬🇧Abu Dhabi 2021, last race of the season. Vestappen and Hamilton, Formula 1 drivers are fighting for the title of World Champion. They face each other at the Yas Marina circuit, both with 369.5 points. Hamilton is fighting for his eighth world championship title, surpassing Michael Schumacher's record number of victories, while Max Verstappen is fighting for his first world championship title. There can only be one winner, which will be decided on the last lap of the final circuit of the season.

This ETL project analyzes the most relevant data of the Abu Dhabi 2021 race, both external such as driver, car, position or result information, as well as detailed data of the fight between Hamilton and Verstappen, specifically on their last lap, by printing the telemetry of both cars.

Verstappen-Hamilton-Abu-Dhabi-2021

🇪🇸Abu Dhabi 2021, última carrera de la temporada. Vestappen y Hamilon, pilotos de Formula 1 luchan por el título de Campeón del mundo. Se enfrentan en el circuito de Yas Marina, ambos con 369,5 puntos. Hamilton lucha por su octavo título de campeón del mundo, superando el récord de victorias de Michael Schumacher, mientras que Max Verstappen pelea por su primer título de Campeón del mundo. Sólo puede haber un ganador, el cual se decidirá en la última vuelta del último circuito de la temporada.

Este proyecto de ETL analiza los datos más relevantes de la carrera Abu Dhabi 2021, tanto externos como la información del piloto, coche, posición o resultados, como datos detallados de la lucha entre Hamilton y Verstappen, específicamente en su última vuelta, mediante la impresión de la telemetría de ambos coches.

PREQUISITES

⭐️ Installation of F1 Race Traces database

⭐️ Installation of fastf1 library

⭐️ Installation of webdriver-manager

SET UP

🏁 Import F1 libraries

🏁 Import pandas, Numpy

🏁 Import Seaborn

🏁 Import Matplotlib

🏁 Import of f1 database (CSV)

🏁 Import warnings

🏁 Import functools

🏁 Import requests

🏁 Import time

STEP BY STEP

✔️ CSV database import

👀 Scraping and obtaining the missing information through Selenium, making use of more than three sources of information

📝 Transformation of the obtained data into DataFrames

💻 Exporting of the scraped DataFrames to CSV

🌍 Data exploration and column correction

🧹 Data and column cleaning

⚡️ Final export to SQL

⚙️ Creation of relations between the different DataFrames in SQL

Captura de Pantalla 2022-11-14 a las 16 38 48

🌈 Obtain information using Queries

TELEMETRY ANALYSIS

🌪 Study of the fastest lap in Qualy

This graph represents the values taken by the drivers on their fastest lap in Qualy. You can see how Verstappen is the one who leads the ranking with 1:22.109 in time while Hamilton follows with 1:22.480 in time. Since it was Verstappen who did the fastest lap, we decided to take a closer look at this lap in qualifying.

Fastest_lap_qualy

🌪 Visualization of the fastest lap in Qualy (Verstappen)

This is Verstappen's fastest lap in Qualy at the Abu Dhabi 2021 circuit in which we analyze using a color scale, with red being maximum speed, followed by less to more speed with colors from cool to warm. It can be seen how the speed has been maximum on the straights while in the curves it has been reduced.

fastes_lao_ver_qualy

🏎 Visualization of the average speed comparison between Hamilton and Verstappen in Qualy

Hamilton is the green color and Verstappen the blue color. Representation of the Abu Dhabi circuit in which you can see how Hamilton is much faster in curves while Verstappen is much faster in straights.

fast_lap_ver y ham_qualy

🏁 Visualization of the fastest lap of the race (Verstappen)

This graph shows Verstappen's race fastest lap on race day and you can see how on Sunday he improves his cornering times. This can be better seen in the average speed comparison graph between VER and HAM. The legend of this graph is from lower speed to cooler tones, from higher speed to warmer tones.

fastest_lap_ver_race

⚡️ Visualization of average fast lap speed comparison between Hamilton and Verstappen in race

This graph belongs to the day of the race, Sunday. In which we see how Verstappen, in blue color improves his time in the corners, this will be better represented in the telemetry analysis of the last lap in which we see how Hamilton becomes faster in the straights while Verstappen accelerates before Hamilton and brakes before him.

ver_ham_fast_lap_race

👀 Visualization of lap comparison between Verstappen and Hamilton

Here we can see represented on the X axis the laps by Hamilton (blue color) and Verstappen (red color) and on the Y axis the race time. We can highlight the jump in the graph representing the exit of the safty car that has not counted as race time.

vueltas_ham_ver

✨ Display comparison of laps between Hamilton and Sainz

Carlos Sainz finished in third place, so we wanted to study the difference per lap between both drivers in order to establish a comparison between Vestappen (1st place) and Hamilton (2nd place) and between Hamilton and Carlos Sainz (3rd place).

ham_sainz_laps

🌪 Hamilton fast lap visualization

ham_fastest_lap

🌪 Verstappen fast lap visualization

ver_fastest_lap

🔥 Alonso fast lap visualization

ALO_fastest_lap

🌶 Sainz fast lap visualization

Sai_fastest_lap

🏁 Visualization of the first Sting comparison between Hamilton and Verstappen

We wanted to analyze the first sting between Hamilton (pink color) and Verstappen (green color), watching their progressive evolution.

sting

🏎 Visualization of the comparison of traces, brakes and acceleration between Hamilton and Verstappen on the last lap

Graph analyzing the telemetry of Hamilton's car (green color) and Verstappen's car (pink color). In the first one, we can see the speed, how Hamilton is totally above Verstappen while Verstappen has an earlier braking than Hamilton (this we can see in the second graph; Brake). Finally we can see how in the last graph, acceleration in which Verstappen accelerates before Hamilton.

Captura de Pantalla 2022-11-14 a las 23 23 26

About

Analysis of the 2021 season of formula 1


Languages

Language:Jupyter Notebook 100.0%