Formula One Prediction
  • Home
  • Data Gathering
    • Record Data
    • Twitter Data
  • Data Cleaning
    • Record Data in R
    • Record Data in Python
    • Twitter Data
  • EDA
  • Naive Bayes’
    • Record Data
    • Twitter Data
  • Decision Trees
  • SVM
  • Clustering
  • ARM
  • Conclusion

On this page

  • Data Cleaning
  • Importing Libraries
  • Importing Data
  • Cleaning the Data

Record Data Cleaning in R

  • Show All Code
  • Hide All Code

  • View Source

Data Cleaning

  • In the era of big data, cleaning or scrubbing your data has become an essential part of the data management process. Even though data cleaning can be tedious at times, it is absolutely crucial for getting accurate business intelligence (BI) that can drive your strategic decisions.
  • Incorrect or inconsistent data leads to false conclusions. And so, how well you clean and understand the data has a high impact on the quality of the results.
  • Data cleaning involve different techniques based on the problem and the data type. Different methods can be applied with each has its own trade-offs. Overall, incorrect data is either removed, corrected, or imputed.
  • Data cleaning is the process of removing incorrect, duplicate, or otherwise erroneous data from a dataset. These errors can include incorrectly formatted data, redundant entries, mislabeled data, and other issues; they often arise when two or more datasets are combined together. Data cleaning improves the quality of your data as well as any business decisions that you draw based on the data.
  • There is no one right way to clean a dataset, as every set is different and presents its own unique slate of errors that need to be corrected. Many data cleaning techniques can now be automated with the help of dedicated software, but some portion of the work must be done manually to ensure the greatest accuracy. Usually this work is done by data quality analysts, BI analysts, and business users.
  • Every organization’s data cleaning methods will vary according to their individual needs as well as the particular constraints of the dataset. However, most data cleaning steps follow a standard framework:
    1. Determine the critical data values you need for your analysis.
    2. Collect the data you need, then sort and organize it.
    3. Identify duplicate or irrelevant values and remove them.
    4. Search for missing values and fill them in, so you have a complete dataset.
    5. Fix any remaining structural or repetitive errors in the dataset.
    6. Identify outliers and remove them, so they will not interfere with your analysis.
    7. Validate your dataset to ensure it is ready for data transformation and analysis.
    8. Once the set has been validated, perform your transformation and analysis.
  • Data Cleaning vs. Data Cleansing vs. Data Scrubbing:
    • You might sometimes hear the terms data cleansing or data scrubbing used instead of data cleaning. In most situations, these terms are all being used interchangeably and refer to the exact same thing. Data scrubbing may sometimes be used to refer to a specific aspect of data cleaning—namely, removing duplicate or bad data from datasets.
    • You should also know that data scrubbing can have a slightly different meaning within the specific context of data storage; in this case, it refers to an automated function that evaluates storage systems and disk drives to identify any bad sectors or blocks and to confirm the data in them can be read.
    • Note that all three of these terms—data cleaning, data cleansing, and data scrubbing—are different from data transformation, which is the act of taking clean data and converting it into a new format or structure. Data transformation is a separate process that comes after data cleaning.
  • Benefits of Data Cleaning:
    • Not having clean data exacts a high price: IBM estimates that bad data costs the U.S. over $3 trillion each year. That’s because data-driven decisions are only as good as the data you are relying on. Bad quality data leads to equally bad quality decisions. If the data you are basing your strategy on is inaccurate, then your strategy will have the same issues present in the data, even if it seems sound. In fact, sometimes no data at all is better than bad data.
    • Cleaning your data results in many benefits for your organization in both the short- and long-term. It leads to better decision making, which can boost your efficiency and your customer satisfaction, in turn giving your business a competitive edge. Over time, it also reduces your costs of data management by preemptively removing errors and other mistakes that would necessitate performing analysis over and over again.

Importing Libraries

Code
library(tidyr)
library(tidyverse)
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0      ✔ dplyr   1.0.10
✔ tibble  3.1.8      ✔ stringr 1.4.1 
✔ readr   2.1.3      ✔ forcats 0.5.2 
✔ purrr   0.3.4      
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
Code
library(plyr)
------------------------------------------------------------------------------
You have loaded plyr after dplyr - this is likely to cause problems.
If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
library(plyr); library(dplyr)
------------------------------------------------------------------------------

Attaching package: 'plyr'

The following objects are masked from 'package:dplyr':

    arrange, count, desc, failwith, id, mutate, rename, summarise,
    summarize

The following object is masked from 'package:purrr':

    compact
Code
library(stringr)

Importing Data

Code
race_df = read_csv("../../data/00-raw-data/race_results.csv")
New names:
Rows: 1096 Columns: 9
── Column specification
──────────────────────────────────────────────────────── Delimiter: "," chr
(5): url, raceName, Circuit, Results, time dbl (3): ...1, season, round date
(1): date
ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
Specify the column types or set `show_col_types = FALSE` to quiet this message.
• `` -> `...1`
Code
circuit_df = read_csv("../../data/00-raw-data/circuit_info.csv")
New names:
Rows: 76 Columns: 5
── Column specification
──────────────────────────────────────────────────────── Delimiter: "," chr
(4): circuitId, url, circuitName, Location dbl (1): ...1
ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
Specify the column types or set `show_col_types = FALSE` to quiet this message.
• `` -> `...1`
Code
driver_df = read_csv('../../data/00-raw-data/drivers.csv')
Rows: 855 Columns: 9
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr  (7): driverRef, number, code, forename, surname, nationality, url
dbl  (1): driverId
date (1): dob

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Cleaning the Data

Dropping unnecesarry columns:

Code
colnames(race_df) = c('index', 'season', 'round', 'url', 'raceName', 'Circuit', 'date', 'Results', 'time')
drop = c("index", "url")
race_df = race_df[,!(names(race_df) %in% drop)]
Code
colnames(circuit_df) = c('index', 'circuitId', 'url', 'circuitName', 'Location')
drop = c("index", "url")
circuit_df = circuit_df[,!(names(circuit_df) %in% drop)]

Removing brackets and apostrophes from the data as it is not needed:

Code
race_df = race_df %>% 
  mutate(across('Circuit', str_replace, fixed("{"), ''),
         across('Circuit', str_replace, fixed("}"), ''))
Code
race_df$circuitId =  word(race_df$Circuit,1,sep = ",")
race_df$circuitId = word(race_df$circuitId,2,sep = ": ")
race_df$circuitId = gsub("'", "", race_df$circuitId)

Merging Dataframes:

Code
df = merge(race_df, circuit_df, by = 'circuitId', all.x = TRUE)
df = df[order(df$season, df$round), ]
head(df)
       circuitId season round           raceName
812  silverstone   1950     1 British Grand Prix
497       monaco   1950     2  Monaco Grand Prix
326 indianapolis   1950     3   Indianapolis 500
102   bremgarten   1950     4   Swiss Grand Prix
919          spa   1950     5 Belgian Grand Prix
731        reims   1950     6  French Grand Prix
                                                                                                                                                                                                                                            Circuit
812                   {'circuitId': 'silverstone', 'url': 'http://en.wikipedia.org/wiki/Silverstone_Circuit', 'circuitName': 'Silverstone Circuit', 'Location': {'lat': '52.0786', 'long': '-1.01694', 'locality': 'Silverstone', 'country': 'UK'}}
497                         {'circuitId': 'monaco', 'url': 'http://en.wikipedia.org/wiki/Circuit_de_Monaco', 'circuitName': 'Circuit de Monaco', 'Location': {'lat': '43.7347', 'long': '7.42056', 'locality': 'Monte-Carlo', 'country': 'Monaco'}}
326 {'circuitId': 'indianapolis', 'url': 'http://en.wikipedia.org/wiki/Indianapolis_Motor_Speedway', 'circuitName': 'Indianapolis Motor Speedway', 'Location': {'lat': '39.795', 'long': '-86.2347', 'locality': 'Indianapolis', 'country': 'USA'}}
102                     {'circuitId': 'bremgarten', 'url': 'http://en.wikipedia.org/wiki/Circuit_Bremgarten', 'circuitName': 'Circuit Bremgarten', 'Location': {'lat': '46.9589', 'long': '7.40194', 'locality': 'Bern', 'country': 'Switzerland'}}
919             {'circuitId': 'spa', 'url': 'http://en.wikipedia.org/wiki/Circuit_de_Spa-Francorchamps', 'circuitName': 'Circuit de Spa-Francorchamps', 'Location': {'lat': '50.4372', 'long': '5.97139', 'locality': 'Spa', 'country': 'Belgium'}}
731                                            {'circuitId': 'reims', 'url': 'http://en.wikipedia.org/wiki/Reims-Gueux', 'circuitName': 'Reims-Gueux', 'Location': {'lat': '49.2542', 'long': '3.93083', 'locality': 'Reims', 'country': 'France'}}
          date
812 1950-05-13
497 1950-05-21
326 1950-05-30
102 1950-06-04
919 1950-06-18
731 1950-07-02
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           Results
812                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [{'number': '2', 'position': '1', 'positionText': '1', 'points': '9', 'Driver': {'driverId': 'farina', 'url': 'http://en.wikipedia.org/wiki/Nino_Farina', 'givenName': 'Nino', 'familyName': 'Farina', 'dateOfBirth': '1906-10-30', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '1', 'laps': '70', 'status': 'Finished', 'Time': {'millis': '8003600', 'time': '2:13:23.6'}}, {'number': '3', 'position': '2', 'positionText': '2', 'points': '6', 'Driver': {'driverId': 'fagioli', 'url': 'http://en.wikipedia.org/wiki/Luigi_Fagioli', 'givenName': 'Luigi', 'familyName': 'Fagioli', 'dateOfBirth': '1898-06-09', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '2', 'laps': '70', 'status': 'Finished', 'Time': {'millis': '8006200', 'time': '+2.6'}}, {'number': '4', 'position': '3', 'positionText': '3', 'points': '4', 'Driver': {'driverId': 'reg_parnell', 'url': 'http://en.wikipedia.org/wiki/Reg_Parnell', 'givenName': 'Reg', 'familyName': 'Parnell', 'dateOfBirth': '1911-07-02', 'nationality': 'British'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '4', 'laps': '70', 'status': 'Finished', 'Time': {'millis': '8055600', 'time': '+52.0'}}, {'number': '14', 'position': '4', 'positionText': '4', 'points': '3', 'Driver': {'driverId': 'cabantous', 'url': 'http://en.wikipedia.org/wiki/Yves_Giraud_Cabantous', 'givenName': 'Yves', 'familyName': 'Cabantous', 'dateOfBirth': '1904-10-08', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '6', 'laps': '68', 'status': '+2 Laps'}, {'number': '15', 'position': '5', 'positionText': '5', 'points': '2', 'Driver': {'driverId': 'rosier', 'url': 'http://en.wikipedia.org/wiki/Louis_Rosier', 'givenName': 'Louis', 'familyName': 'Rosier', 'dateOfBirth': '1905-11-05', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '9', 'laps': '68', 'status': '+2 Laps'}, {'number': '12', 'position': '6', 'positionText': '6', 'points': '0', 'Driver': {'driverId': 'gerard', 'url': 'http://en.wikipedia.org/wiki/Bob_Gerard', 'givenName': 'Bob', 'familyName': 'Gerard', 'dateOfBirth': '1914-01-19', 'nationality': 'British'}, 'Constructor': {'constructorId': 'era', 'url': 'http://en.wikipedia.org/wiki/English_Racing_Automobiles', 'name': 'ERA', 'nationality': 'British'}, 'grid': '13', 'laps': '67', 'status': '+3 Laps'}, {'number': '11', 'position': '7', 'positionText': '7', 'points': '0', 'Driver': {'driverId': 'harrison', 'url': 'http://en.wikipedia.org/wiki/Cuth_Harrison', 'givenName': 'Cuth', 'familyName': 'Harrison', 'dateOfBirth': '1906-07-06', 'nationality': 'British'}, 'Constructor': {'constructorId': 'era', 'url': 'http://en.wikipedia.org/wiki/English_Racing_Automobiles', 'name': 'ERA', 'nationality': 'British'}, 'grid': '15', 'laps': '67', 'status': '+3 Laps'}, {'number': '16', 'position': '8', 'positionText': '8', 'points': '0', 'Driver': {'driverId': 'etancelin', 'url': 'http://en.wikipedia.org/wiki/Philippe_%C3%89tancelin', 'givenName': 'Philippe', 'familyName': 'Étancelin', 'dateOfBirth': '1896-12-28', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '14', 'laps': '65', 'status': '+5 Laps'}, {'number': '6', 'position': '9', 'positionText': '9', 'points': '0', 'Driver': {'driverId': 'hampshire', 'url': 'http://en.wikipedia.org/wiki/David_Hampshire', 'givenName': 'David', 'familyName': 'Hampshire', 'dateOfBirth': '1917-12-29', 'nationality': 'British'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '16', 'laps': '64', 'status': '+6 Laps'}, {'number': '10', 'position': '10', 'positionText': '10', 'points': '0', 'Driver': {'driverId': 'shawe_taylor', 'url': 'http://en.wikipedia.org/wiki/Brian_Shawe_Taylor', 'givenName': 'Brian', 'familyName': 'Shawe Taylor', 'dateOfBirth': '1915-01-28', 'nationality': 'British'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '20', 'laps': '64', 'status': '+6 Laps'}, {'number': '10', 'position': '10', 'positionText': '10', 'points': '0', 'Driver': {'driverId': 'fry', 'url': 'http://en.wikipedia.org/wiki/Joe_Fry', 'givenName': 'Joe', 'familyName': 'Fry', 'dateOfBirth': '1915-10-26', 'nationality': 'British'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '20', 'laps': '64', 'status': '+6 Laps'}, {'number': '18', 'position': '11', 'positionText': '11', 'points': '0', 'Driver': {'driverId': 'claes', 'url': 'http://en.wikipedia.org/wiki/Johnny_Claes', 'givenName': 'Johnny', 'familyName': 'Claes', 'dateOfBirth': '1916-08-11', 'nationality': 'Belgian'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '21', 'laps': '64', 'status': '+6 Laps'}, {'number': '1', 'position': '12', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'fangio', 'url': 'http://en.wikipedia.org/wiki/Juan_Manuel_Fangio', 'givenName': 'Juan', 'familyName': 'Fangio', 'dateOfBirth': '1911-06-24', 'nationality': 'Argentine'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '3', 'laps': '62', 'status': 'Oil leak'}, {'number': '23', 'position': '13', 'positionText': 'N', 'points': '0', 'Driver': {'driverId': 'kelly', 'url': 'http://en.wikipedia.org/wiki/Joe_Kelly_(Formula_One)', 'givenName': 'Joe', 'familyName': 'Kelly', 'dateOfBirth': '1913-03-13', 'nationality': 'Irish'}, 'Constructor': {'constructorId': 'alta', 'url': 'http://en.wikipedia.org/wiki/Alta_auto_racing_team', 'name': 'Alta', 'nationality': 'British'}, 'grid': '19', 'laps': '57', 'status': 'Not classified'}, {'number': '21', 'position': '14', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'bira', 'url': 'http://en.wikipedia.org/wiki/Prince_Bira', 'givenName': 'Prince', 'familyName': 'Bira', 'dateOfBirth': '1914-07-15', 'nationality': 'Thai'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '5', 'laps': '49', 'status': 'Out of fuel'}, {'number': '5', 'position': '15', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'murray', 'url': 'http://en.wikipedia.org/wiki/David_Murray_(driver)', 'givenName': 'David', 'familyName': 'Murray', 'dateOfBirth': '1909-12-28', 'nationality': 'British'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '18', 'laps': '44', 'status': 'Engine'}, {'number': '24', 'position': '16', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'crossley', 'url': 'http://en.wikipedia.org/wiki/Geoff_Crossley', 'givenName': 'Geoff', 'familyName': 'Crossley', 'dateOfBirth': '1921-05-11', 'nationality': 'British'}, 'Constructor': {'constructorId': 'alta', 'url': 'http://en.wikipedia.org/wiki/Alta_auto_racing_team', 'name': 'Alta', 'nationality': 'British'}, 'grid': '17', 'laps': '43', 'status': 'Transmission'}, {'number': '20', 'position': '17', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'graffenried', 'url': 'http://en.wikipedia.org/wiki/Toulo_de_Graffenried', 'givenName': 'Toulo', 'familyName': 'de Graffenried', 'dateOfBirth': '1914-05-18', 'nationality': 'Swiss'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '8', 'laps': '36', 'status': 'Engine'}, {'number': '19', 'position': '18', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'chiron', 'url': 'http://en.wikipedia.org/wiki/Louis_Chiron', 'givenName': 'Louis', 'familyName': 'Chiron', 'dateOfBirth': '1899-08-03', 'nationality': 'Monegasque'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '11', 'laps': '26', 'status': 'Clutch'}, {'number': '17', 'position': '19', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'martin', 'url': 'http://en.wikipedia.org/wiki/Eug%C3%A8ne_Martin', 'givenName': 'Eugène', 'familyName': 'Martin', 'dateOfBirth': '1915-03-24', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '7', 'laps': '8', 'status': 'Oil pressure'}, {'number': '9', 'position': '20', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'peter_walker', 'url': 'http://en.wikipedia.org/wiki/Peter_Walker_(driver)', 'givenName': 'Peter', 'familyName': 'Walker', 'dateOfBirth': '1912-10-07', 'nationality': 'British'}, 'Constructor': {'constructorId': 'era', 'url': 'http://en.wikipedia.org/wiki/English_Racing_Automobiles', 'name': 'ERA', 'nationality': 'British'}, 'grid': '10', 'laps': '5', 'status': 'Gearbox'}, {'number': '9', 'position': '20', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'rolt', 'url': 'http://en.wikipedia.org/wiki/Tony_Rolt', 'givenName': 'Tony', 'familyName': 'Rolt', 'dateOfBirth': '1918-10-16', 'nationality': 'British'}, 'Constructor': {'constructorId': 'era', 'url': 'http://en.wikipedia.org/wiki/English_Racing_Automobiles', 'name': 'ERA', 'nationality': 'British'}, 'grid': '10', 'laps': '5', 'status': 'Gearbox'}, {'number': '8', 'position': '21', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'leslie_johnson', 'url': 'http://en.wikipedia.org/wiki/Leslie_Johnson_(racing_driver)', 'givenName': 'Leslie', 'familyName': 'Johnson', 'dateOfBirth': '1912-03-22', 'nationality': 'British'}, 'Constructor': {'constructorId': 'era', 'url': 'http://en.wikipedia.org/wiki/English_Racing_Automobiles', 'name': 'ERA', 'nationality': 'British'}, 'grid': '12', 'laps': '2', 'status': 'Supercharger'}]
497                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [{'number': '34', 'position': '1', 'positionText': '1', 'points': '9', 'Driver': {'driverId': 'fangio', 'url': 'http://en.wikipedia.org/wiki/Juan_Manuel_Fangio', 'givenName': 'Juan', 'familyName': 'Fangio', 'dateOfBirth': '1911-06-24', 'nationality': 'Argentine'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '1', 'laps': '100', 'status': 'Finished', 'Time': {'millis': '11598700', 'time': '3:13:18.7'}}, {'number': '40', 'position': '2', 'positionText': '2', 'points': '6', 'Driver': {'driverId': 'ascari', 'url': 'http://en.wikipedia.org/wiki/Alberto_Ascari', 'givenName': 'Alberto', 'familyName': 'Ascari', 'dateOfBirth': '1918-07-13', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'ferrari', 'url': 'http://en.wikipedia.org/wiki/Scuderia_Ferrari', 'name': 'Ferrari', 'nationality': 'Italian'}, 'grid': '7', 'laps': '99', 'status': '+1 Lap'}, {'number': '48', 'position': '3', 'positionText': '3', 'points': '4', 'Driver': {'driverId': 'chiron', 'url': 'http://en.wikipedia.org/wiki/Louis_Chiron', 'givenName': 'Louis', 'familyName': 'Chiron', 'dateOfBirth': '1899-08-03', 'nationality': 'Monegasque'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '8', 'laps': '98', 'status': '+2 Laps'}, {'number': '42', 'position': '4', 'positionText': '4', 'points': '3', 'Driver': {'driverId': 'sommer', 'url': 'http://en.wikipedia.org/wiki/Raymond_Sommer', 'givenName': 'Raymond', 'familyName': 'Sommer', 'dateOfBirth': '1906-08-31', 'nationality': 'French'}, 'Constructor': {'constructorId': 'ferrari', 'url': 'http://en.wikipedia.org/wiki/Scuderia_Ferrari', 'name': 'Ferrari', 'nationality': 'Italian'}, 'grid': '9', 'laps': '97', 'status': '+3 Laps'}, {'number': '50', 'position': '5', 'positionText': '5', 'points': '2', 'Driver': {'driverId': 'bira', 'url': 'http://en.wikipedia.org/wiki/Prince_Bira', 'givenName': 'Prince', 'familyName': 'Bira', 'dateOfBirth': '1914-07-15', 'nationality': 'Thai'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '15', 'laps': '95', 'status': '+5 Laps'}, {'number': '26', 'position': '6', 'positionText': '6', 'points': '0', 'Driver': {'driverId': 'gerard', 'url': 'http://en.wikipedia.org/wiki/Bob_Gerard', 'givenName': 'Bob', 'familyName': 'Gerard', 'dateOfBirth': '1914-01-19', 'nationality': 'British'}, 'Constructor': {'constructorId': 'era', 'url': 'http://en.wikipedia.org/wiki/English_Racing_Automobiles', 'name': 'ERA', 'nationality': 'British'}, 'grid': '16', 'laps': '94', 'status': '+6 Laps'}, {'number': '6', 'position': '7', 'positionText': '7', 'points': '0', 'Driver': {'driverId': 'claes', 'url': 'http://en.wikipedia.org/wiki/Johnny_Claes', 'givenName': 'Johnny', 'familyName': 'Claes', 'dateOfBirth': '1916-08-11', 'nationality': 'Belgian'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '19', 'laps': '94', 'status': '+6 Laps'}, {'number': '38', 'position': '8', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'villoresi', 'url': 'http://en.wikipedia.org/wiki/Luigi_Villoresi', 'givenName': 'Luigi', 'familyName': 'Villoresi', 'dateOfBirth': '1909-05-16', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'ferrari', 'url': 'http://en.wikipedia.org/wiki/Scuderia_Ferrari', 'name': 'Ferrari', 'nationality': 'Italian'}, 'grid': '6', 'laps': '63', 'status': 'Axle'}, {'number': '14', 'position': '9', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'etancelin', 'url': 'http://en.wikipedia.org/wiki/Philippe_%C3%89tancelin', 'givenName': 'Philippe', 'familyName': 'Étancelin', 'dateOfBirth': '1896-12-28', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '4', 'laps': '38', 'status': 'Oil leak'}, {'number': '2', 'position': '10', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'gonzalez', 'url': 'http://en.wikipedia.org/wiki/Jos%C3%A9_Froil%C3%A1n_Gonz%C3%A1lez', 'givenName': 'José Froilán', 'familyName': 'González', 'dateOfBirth': '1922-10-05', 'nationality': 'Argentine'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '3', 'laps': '1', 'status': 'Accident'}, {'number': '32', 'position': '11', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'farina', 'url': 'http://en.wikipedia.org/wiki/Nino_Farina', 'givenName': 'Nino', 'familyName': 'Farina', 'dateOfBirth': '1906-10-30', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '2', 'laps': '0', 'status': 'Accident'}, {'number': '36', 'position': '12', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'fagioli', 'url': 'http://en.wikipedia.org/wiki/Luigi_Fagioli', 'givenName': 'Luigi', 'familyName': 'Fagioli', 'dateOfBirth': '1898-06-09', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '5', 'laps': '0', 'status': 'Accident'}, {'number': '16', 'position': '13', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'rosier', 'url': 'http://en.wikipedia.org/wiki/Louis_Rosier', 'givenName': 'Louis', 'familyName': 'Rosier', 'dateOfBirth': '1905-11-05', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '10', 'laps': '0', 'status': 'Accident'}, {'number': '10', 'position': '14', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'manzon', 'url': 'http://en.wikipedia.org/wiki/Robert_Manzon', 'givenName': 'Robert', 'familyName': 'Manzon', 'dateOfBirth': '1917-04-12', 'nationality': 'French'}, 'Constructor': {'constructorId': 'simca', 'url': 'http://en.wikipedia.org/wiki/Simca', 'name': 'Simca', 'nationality': 'French'}, 'grid': '11', 'laps': '0', 'status': 'Accident'}, {'number': '52', 'position': '15', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'graffenried', 'url': 'http://en.wikipedia.org/wiki/Toulo_de_Graffenried', 'givenName': 'Toulo', 'familyName': 'de Graffenried', 'dateOfBirth': '1914-05-18', 'nationality': 'Swiss'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '12', 'laps': '0', 'status': 'Accident'}, {'number': '12', 'position': '16', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'trintignant', 'url': 'http://en.wikipedia.org/wiki/Maurice_Trintignant', 'givenName': 'Maurice', 'familyName': 'Trintignant', 'dateOfBirth': '1917-10-30', 'nationality': 'French'}, 'Constructor': {'constructorId': 'simca', 'url': 'http://en.wikipedia.org/wiki/Simca', 'name': 'Simca', 'nationality': 'French'}, 'grid': '13', 'laps': '0', 'status': 'Accident'}, {'number': '24', 'position': '17', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'harrison', 'url': 'http://en.wikipedia.org/wiki/Cuth_Harrison', 'givenName': 'Cuth', 'familyName': 'Harrison', 'dateOfBirth': '1906-07-06', 'nationality': 'British'}, 'Constructor': {'constructorId': 'era', 'url': 'http://en.wikipedia.org/wiki/English_Racing_Automobiles', 'name': 'ERA', 'nationality': 'British'}, 'grid': '14', 'laps': '0', 'status': 'Accident'}, {'number': '44', 'position': '18', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'rol', 'url': 'http://en.wikipedia.org/wiki/Franco_Rol', 'givenName': 'Franco', 'familyName': 'Rol', 'dateOfBirth': '1908-06-05', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '17', 'laps': '0', 'status': 'Accident'}, {'number': '8', 'position': '19', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'schell', 'url': 'http://en.wikipedia.org/wiki/Harry_Schell', 'givenName': 'Harry', 'familyName': 'Schell', 'dateOfBirth': '1921-06-29', 'nationality': 'American'}, 'Constructor': {'constructorId': 'cooper', 'url': 'http://en.wikipedia.org/wiki/Cooper_Car_Company', 'name': 'Cooper', 'nationality': 'British'}, 'grid': '20', 'laps': '0', 'status': 'Collision'}, {'number': '28', 'position': '20', 'positionText': 'W', 'points': '0', 'Driver': {'driverId': 'whitehead', 'url': 'http://en.wikipedia.org/wiki/Peter_Whitehead_(racing_driver)', 'givenName': 'Peter', 'familyName': 'Whitehead', 'dateOfBirth': '1914-11-12', 'nationality': 'British'}, 'Constructor': {'constructorId': 'ferrari', 'url': 'http://en.wikipedia.org/wiki/Scuderia_Ferrari', 'name': 'Ferrari', 'nationality': 'Italian'}, 'grid': '21', 'laps': '0', 'status': 'Engine'}, {'number': '4', 'position': '21', 'positionText': 'W', 'points': '0', 'Driver': {'driverId': 'pian', 'url': 'http://en.wikipedia.org/wiki/Alfredo_Pi%C3%A0n', 'givenName': 'Alfredo', 'familyName': 'Pián', 'dateOfBirth': '1912-10-21', 'nationality': 'Argentine'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '18', 'laps': '0', 'status': 'Accident'}]
326 [{'number': '1', 'position': '1', 'positionText': '1', 'points': '9', 'Driver': {'driverId': 'parsons', 'url': 'http://en.wikipedia.org/wiki/Johnnie_Parsons', 'givenName': 'Johnnie', 'familyName': 'Parsons', 'dateOfBirth': '1918-07-04', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '5', 'laps': '138', 'status': 'Finished', 'Time': {'millis': '10015970', 'time': '2:46:55.97'}}, {'number': '3', 'position': '2', 'positionText': '2', 'points': '6', 'Driver': {'driverId': 'holland', 'url': 'http://en.wikipedia.org/wiki/Bill_Holland', 'givenName': 'Bill', 'familyName': 'Holland', 'dateOfBirth': '1907-12-18', 'nationality': 'American'}, 'Constructor': {'constructorId': 'deidt', 'url': 'http://en.wikipedia.org/wiki/Deidt', 'name': 'Deidt', 'nationality': 'American'}, 'grid': '10', 'laps': '137', 'status': '+1 Lap'}, {'number': '31', 'position': '3', 'positionText': '3', 'points': '4', 'Driver': {'driverId': 'rose', 'url': 'http://en.wikipedia.org/wiki/Mauri_Rose', 'givenName': 'Mauri', 'familyName': 'Rose', 'dateOfBirth': '1906-05-26', 'nationality': 'American'}, 'Constructor': {'constructorId': 'deidt', 'url': 'http://en.wikipedia.org/wiki/Deidt', 'name': 'Deidt', 'nationality': 'American'}, 'grid': '3', 'laps': '137', 'status': '+1 Lap'}, {'number': '54', 'position': '4', 'positionText': '4', 'points': '3', 'Driver': {'driverId': 'green', 'url': 'http://en.wikipedia.org/wiki/Cecil_Green', 'givenName': 'Cecil', 'familyName': 'Green', 'dateOfBirth': '1919-09-30', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '12', 'laps': '137', 'status': '+1 Lap'}, {'number': '17', 'position': '5', 'positionText': '5', 'points': '1', 'Driver': {'driverId': 'chitwood', 'url': 'http://en.wikipedia.org/wiki/Joie_Chitwood', 'givenName': 'Joie', 'familyName': 'Chitwood', 'dateOfBirth': '1912-04-14', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '9', 'laps': '136', 'status': '+2 Laps'}, {'number': '17', 'position': '5', 'positionText': '5', 'points': '1', 'Driver': {'driverId': 'bettenhausen', 'url': 'http://en.wikipedia.org/wiki/Tony_Bettenhausen', 'givenName': 'Tony', 'familyName': 'Bettenhausen', 'dateOfBirth': '1916-09-12', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '9', 'laps': '136', 'status': '+2 Laps'}, {'number': '8', 'position': '6', 'positionText': '6', 'points': '0', 'Driver': {'driverId': 'wallard', 'url': 'http://en.wikipedia.org/wiki/Lee_Wallard', 'givenName': 'Lee', 'familyName': 'Wallard', 'dateOfBirth': '1910-09-07', 'nationality': 'American'}, 'Constructor': {'constructorId': 'moore', 'url': 'http://en.wikipedia.org/wiki/Moore_(constructor)', 'name': 'Moore', 'nationality': 'American'}, 'grid': '23', 'laps': '136', 'status': '+2 Laps'}, {'number': '98', 'position': '7', 'positionText': '7', 'points': '0', 'Driver': {'driverId': 'faulkner', 'url': 'http://en.wikipedia.org/wiki/Walt_Faulkner', 'givenName': 'Walt', 'familyName': 'Faulkner', 'dateOfBirth': '1920-02-16', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '1', 'laps': '135', 'status': '+3 Laps'}, {'number': '5', 'position': '8', 'positionText': '8', 'points': '0', 'Driver': {'driverId': 'george_connor', 'url': 'http://en.wikipedia.org/wiki/George_Connor_(driver)', 'givenName': 'George', 'familyName': 'Connor', 'dateOfBirth': '1906-08-16', 'nationality': 'American'}, 'Constructor': {'constructorId': 'lesovsky', 'url': 'http://en.wikipedia.org/wiki/Lesovsky', 'name': 'Lesovsky', 'nationality': 'American'}, 'grid': '4', 'laps': '135', 'status': '+3 Laps'}, {'number': '7', 'position': '9', 'positionText': '9', 'points': '0', 'Driver': {'driverId': 'paul_russo', 'url': 'http://en.wikipedia.org/wiki/Paul_Russo', 'givenName': 'Paul', 'familyName': 'Russo', 'dateOfBirth': '1914-04-10', 'nationality': 'American'}, 'Constructor': {'constructorId': 'nichels', 'url': 'http://en.wikipedia.org/wiki/Nichels', 'name': 'Nichels', 'nationality': 'American'}, 'grid': '19', 'laps': '135', 'status': '+3 Laps'}, {'number': '59', 'position': '10', 'positionText': '10', 'points': '0', 'Driver': {'driverId': 'flaherty', 'url': 'http://en.wikipedia.org/wiki/Pat_Flaherty_(racing_driver)', 'givenName': 'Pat', 'familyName': 'Flaherty', 'dateOfBirth': '1926-01-06', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '11', 'laps': '135', 'status': '+3 Laps'}, {'number': '2', 'position': '11', 'positionText': '11', 'points': '0', 'Driver': {'driverId': 'fohr', 'url': 'http://en.wikipedia.org/wiki/Myron_Fohr', 'givenName': 'Myron', 'familyName': 'Fohr', 'dateOfBirth': '1912-06-17', 'nationality': 'American'}, 'Constructor': {'constructorId': 'marchese', 'url': 'http://en.wikipedia.org/wiki/Marchese_(constructor)', 'name': 'Marchese', 'nationality': 'American'}, 'grid': '16', 'laps': '133', 'status': '+5 Laps'}, {'number': '18', 'position': '12', 'positionText': '12', 'points': '0', 'Driver': {'driverId': 'darter', 'url': 'http://en.wikipedia.org/wiki/Duane_Carter', 'givenName': 'Duane', 'familyName': 'Carter', 'dateOfBirth': '1913-05-05', 'nationality': 'American'}, 'Constructor': {'constructorId': 'stevens', 'url': 'http://en.wikipedia.org/wiki/Stevens_(constructor)', 'name': 'Stevens', 'nationality': 'American'}, 'grid': '13', 'laps': '133', 'status': '+5 Laps'}, {'number': '15', 'position': '13', 'positionText': '13', 'points': '0', 'Driver': {'driverId': 'hellings', 'url': 'http://en.wikipedia.org/wiki/Mack_Hellings', 'givenName': 'Mack', 'familyName': 'Hellings', 'dateOfBirth': '1915-09-14', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '26', 'laps': '132', 'status': '+6 Laps'}, {'number': '49', 'position': '14', 'positionText': '14', 'points': '0', 'Driver': {'driverId': 'mcgrath', 'url': 'http://en.wikipedia.org/wiki/Jack_McGrath_(racing_driver)', 'givenName': 'Jack', 'familyName': 'McGrath', 'dateOfBirth': '1919-10-08', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '6', 'laps': '131', 'status': 'Spun off'}, {'number': '55', 'position': '15', 'positionText': '15', 'points': '0', 'Driver': {'driverId': 'ruttman', 'url': 'http://en.wikipedia.org/wiki/Troy_Ruttman', 'givenName': 'Troy', 'familyName': 'Ruttman', 'dateOfBirth': '1930-03-11', 'nationality': 'American'}, 'Constructor': {'constructorId': 'lesovsky', 'url': 'http://en.wikipedia.org/wiki/Lesovsky', 'name': 'Lesovsky', 'nationality': 'American'}, 'grid': '24', 'laps': '130', 'status': '+8 Laps'}, {'number': '75', 'position': '16', 'positionText': '16', 'points': '0', 'Driver': {'driverId': 'hartley', 'url': 'http://en.wikipedia.org/wiki/Gene_Hartley', 'givenName': 'Gene', 'familyName': 'Hartley', 'dateOfBirth': '1926-01-28', 'nationality': 'American'}, 'Constructor': {'constructorId': 'langley', 'url': 'http://en.wikipedia.org/wiki/Langley_(constructor)', 'name': 'Langley', 'nationality': 'American'}, 'grid': '31', 'laps': '128', 'status': '+10 Laps'}, {'number': '22', 'position': '17', 'positionText': '17', 'points': '0', 'Driver': {'driverId': 'davies', 'url': 'http://en.wikipedia.org/wiki/Jimmy_Davies', 'givenName': 'Jimmy', 'familyName': 'Davies', 'dateOfBirth': '1929-08-08', 'nationality': 'American'}, 'Constructor': {'constructorId': 'ewing', 'url': 'http://en.wikipedia.org/wiki/Ewing_(constructor)', 'name': 'Ewing', 'nationality': 'American'}, 'grid': '27', 'laps': '128', 'status': '+10 Laps'}, {'number': '62', 'position': '18', 'positionText': '18', 'points': '0', 'Driver': {'driverId': 'mcdowell', 'url': 'http://en.wikipedia.org/wiki/Johnny_McDowell', 'givenName': 'Johnny', 'familyName': 'McDowell', 'dateOfBirth': '1915-01-29', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '33', 'laps': '128', 'status': '+10 Laps'}, {'number': '4', 'position': '19', 'positionText': '19', 'points': '0', 'Driver': {'driverId': 'walt_brown', 'url': 'http://en.wikipedia.org/wiki/Walt_Brown_(auto_racer)', 'givenName': 'Walt', 'familyName': 'Brown', 'dateOfBirth': '1911-12-30', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '20', 'laps': '127', 'status': '+11 Laps'}, {'number': '21', 'position': '20', 'positionText': '20', 'points': '0', 'Driver': {'driverId': 'webb', 'url': 'http://en.wikipedia.org/wiki/Travis_Webb', 'givenName': 'Travis', 'familyName': 'Webb', 'dateOfBirth': '1910-10-08', 'nationality': 'American'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '14', 'laps': '126', 'status': '+12 Laps'}, {'number': '81', 'position': '21', 'positionText': '21', 'points': '0', 'Driver': {'driverId': 'hoyt', 'url': 'http://en.wikipedia.org/wiki/Jerry_Hoyt', 'givenName': 'Jerry', 'familyName': 'Hoyt', 'dateOfBirth': '1929-01-29', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '15', 'laps': '125', 'status': '+13 Laps'}, {'number': '27', 'position': '22', 'positionText': '22', 'points': '0', 'Driver': {'driverId': 'ader', 'url': 'http://en.wikipedia.org/wiki/Walt_Ader', 'givenName': 'Walt', 'familyName': 'Ader', 'dateOfBirth': '1913-12-15', 'nationality': 'American'}, 'Constructor': {'constructorId': 'rae', 'url': 'http://en.wikipedia.org/wiki/Rae_(motorsport)', 'name': 'Rae', 'nationality': 'American'}, 'grid': '29', 'laps': '123', 'status': '+15 Laps'}, {'number': '77', 'position': '23', 'positionText': '23', 'points': '0', 'Driver': {'driverId': 'holmes', 'url': 'http://en.wikipedia.org/wiki/Jackie_Holmes', 'givenName': 'Jackie', 'familyName': 'Holmes', 'dateOfBirth': '1920-09-04', 'nationality': 'American'}, 'Constructor': {'constructorId': 'olson', 'url': 'http://en.wikipedia.org/wiki/Olson_(constructor)', 'name': 'Olson', 'nationality': 'American'}, 'grid': '30', 'laps': '123', 'status': 'Spun off'}, {'number': '76', 'position': '24', 'positionText': '24', 'points': '0', 'Driver': {'driverId': 'rathmann', 'url': 'http://en.wikipedia.org/wiki/Jim_Rathmann', 'givenName': 'Jim', 'familyName': 'Rathmann', 'dateOfBirth': '1928-07-16', 'nationality': 'American'}, 'Constructor': {'constructorId': 'wetteroth', 'url': 'http://en.wikipedia.org/wiki/Wetteroth', 'name': 'Wetteroth', 'nationality': 'American'}, 'grid': '28', 'laps': '122', 'status': '+16 Laps'}, {'number': '12', 'position': '25', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'banks', 'url': 'http://en.wikipedia.org/wiki/Henry_Banks', 'givenName': 'Henry', 'familyName': 'Banks', 'dateOfBirth': '1913-06-14', 'nationality': 'American'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '21', 'laps': '112', 'status': 'Oil line'}, {'number': '67', 'position': '26', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'schindler', 'url': 'http://en.wikipedia.org/wiki/Bill_Schindler', 'givenName': 'Bill', 'familyName': 'Schindler', 'dateOfBirth': '1909-03-06', 'nationality': 'American'}, 'Constructor': {'constructorId': 'snowberger', 'url': 'http://en.wikipedia.org/wiki/Snowberger', 'name': 'Snowberger', 'nationality': 'American'}, 'grid': '22', 'laps': '111', 'status': 'Transmission'}, {'number': '24', 'position': '27', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'levrett', 'url': 'http://en.wikipedia.org/wiki/Bayliss_Levrett', 'givenName': 'Bayliss', 'familyName': 'Levrett', 'dateOfBirth': '1914-02-14', 'nationality': 'American'}, 'Constructor': {'constructorId': 'adams', 'url': 'http://en.wikipedia.org/wiki/Adams_(constructor)', 'name': 'Adams', 'nationality': 'American'}, 'grid': '17', 'laps': '108', 'status': 'Oil pressure'}, {'number': '24', 'position': '27', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'cantrell', 'url': 'http://en.wikipedia.org/wiki/William_Cantrell', 'givenName': 'Bill', 'familyName': 'Cantrell', 'dateOfBirth': '1908-01-31', 'nationality': 'American'}, 'Constructor': {'constructorId': 'adams', 'url': 'http://en.wikipedia.org/wiki/Adams_(constructor)', 'name': 'Adams', 'nationality': 'American'}, 'grid': '17', 'laps': '108', 'status': 'Oil pressure'}, {'number': '28', 'position': '28', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'agabashian', 'url': 'http://en.wikipedia.org/wiki/Fred_Agabashian', 'givenName': 'Fred', 'familyName': 'Agabashian', 'dateOfBirth': '1913-08-21', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '2', 'laps': '64', 'status': 'Oil leak'}, {'number': '61', 'position': '29', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'jackson', 'url': 'http://en.wikipedia.org/wiki/Jimmy_Jackson_(driver)', 'givenName': 'Jimmy', 'familyName': 'Jackson', 'dateOfBirth': '1910-07-25', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '32', 'laps': '52', 'status': 'Supercharger'}, {'number': '23', 'position': '30', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'hanks', 'url': 'http://en.wikipedia.org/wiki/Sam_Hanks', 'givenName': 'Sam', 'familyName': 'Hanks', 'dateOfBirth': '1914-07-13', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '25', 'laps': '42', 'status': 'Oil pressure'}, {'number': '14', 'position': '31', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'bettenhausen', 'url': 'http://en.wikipedia.org/wiki/Tony_Bettenhausen', 'givenName': 'Tony', 'familyName': 'Bettenhausen', 'dateOfBirth': '1916-09-12', 'nationality': 'American'}, 'Constructor': {'constructorId': 'deidt', 'url': 'http://en.wikipedia.org/wiki/Deidt', 'name': 'Deidt', 'nationality': 'American'}, 'grid': '8', 'laps': '30', 'status': 'Wheel bearing'}, {'number': '45', 'position': '32', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'dick_rathmann', 'url': 'http://en.wikipedia.org/wiki/Dick_Rathmann', 'givenName': 'Dick', 'familyName': 'Rathmann', 'dateOfBirth': '1924-01-06', 'nationality': 'American'}, 'Constructor': {'constructorId': 'watson', 'url': 'http://en.wikipedia.org/wiki/A.J._Watson', 'name': 'Watson', 'nationality': 'American'}, 'grid': '18', 'laps': '25', 'status': 'Stalled'}, {'number': '69', 'position': '33', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'dinsmore', 'url': 'http://en.wikipedia.org/wiki/Duke_Dinsmore', 'givenName': 'Duke', 'familyName': 'Dinsmore', 'dateOfBirth': '1913-04-10', 'nationality': 'American'}, 'Constructor': {'constructorId': 'kurtis_kraft', 'url': 'http://en.wikipedia.org/wiki/Kurtis_Kraft', 'name': 'Kurtis Kraft', 'nationality': 'American'}, 'grid': '7', 'laps': '10', 'status': 'Oil leak'}]
102                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [{'number': '16', 'position': '1', 'positionText': '1', 'points': '9', 'Driver': {'driverId': 'farina', 'url': 'http://en.wikipedia.org/wiki/Nino_Farina', 'givenName': 'Nino', 'familyName': 'Farina', 'dateOfBirth': '1906-10-30', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '2', 'laps': '42', 'status': 'Finished', 'Time': {'millis': '7373700', 'time': '2:02:53.7'}}, {'number': '12', 'position': '2', 'positionText': '2', 'points': '6', 'Driver': {'driverId': 'fagioli', 'url': 'http://en.wikipedia.org/wiki/Luigi_Fagioli', 'givenName': 'Luigi', 'familyName': 'Fagioli', 'dateOfBirth': '1898-06-09', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '3', 'laps': '42', 'status': 'Finished', 'Time': {'millis': '7374100', 'time': '+0.4'}}, {'number': '10', 'position': '3', 'positionText': '3', 'points': '4', 'Driver': {'driverId': 'rosier', 'url': 'http://en.wikipedia.org/wiki/Louis_Rosier', 'givenName': 'Louis', 'familyName': 'Rosier', 'dateOfBirth': '1905-11-05', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '10', 'laps': '41', 'status': '+1 Lap'}, {'number': '30', 'position': '4', 'positionText': '4', 'points': '3', 'Driver': {'driverId': 'bira', 'url': 'http://en.wikipedia.org/wiki/Prince_Bira', 'givenName': 'Prince', 'familyName': 'Bira', 'dateOfBirth': '1914-07-15', 'nationality': 'Thai'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '8', 'laps': '40', 'status': '+2 Laps'}, {'number': '34', 'position': '5', 'positionText': '5', 'points': '2', 'Driver': {'driverId': 'bonetto', 'url': 'http://en.wikipedia.org/wiki/Felice_Bonetto', 'givenName': 'Felice', 'familyName': 'Bonetto', 'dateOfBirth': '1903-06-09', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '12', 'laps': '40', 'status': '+2 Laps'}, {'number': '32', 'position': '6', 'positionText': '6', 'points': '0', 'Driver': {'driverId': 'graffenried', 'url': 'http://en.wikipedia.org/wiki/Toulo_de_Graffenried', 'givenName': 'Toulo', 'familyName': 'de Graffenried', 'dateOfBirth': '1914-05-18', 'nationality': 'Swiss'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '11', 'laps': '40', 'status': '+2 Laps'}, {'number': '2', 'position': '7', 'positionText': '7', 'points': '0', 'Driver': {'driverId': 'pagani', 'url': 'http://en.wikipedia.org/wiki/Nello_Pagani', 'givenName': 'Nello', 'familyName': 'Pagani', 'dateOfBirth': '1911-10-11', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '15', 'laps': '39', 'status': '+3 Laps'}, {'number': '44', 'position': '8', 'positionText': '8', 'points': '0', 'Driver': {'driverId': 'schell', 'url': 'http://en.wikipedia.org/wiki/Harry_Schell', 'givenName': 'Harry', 'familyName': 'Schell', 'dateOfBirth': '1921-06-29', 'nationality': 'American'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '18', 'laps': '39', 'status': '+3 Laps'}, {'number': '26', 'position': '9', 'positionText': '9', 'points': '0', 'Driver': {'driverId': 'chiron', 'url': 'http://en.wikipedia.org/wiki/Louis_Chiron', 'givenName': 'Louis', 'familyName': 'Chiron', 'dateOfBirth': '1899-08-03', 'nationality': 'Monegasque'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '16', 'laps': '39', 'status': '+3 Laps'}, {'number': '4', 'position': '10', 'positionText': '10', 'points': '0', 'Driver': {'driverId': 'claes', 'url': 'http://en.wikipedia.org/wiki/Johnny_Claes', 'givenName': 'Johnny', 'familyName': 'Claes', 'dateOfBirth': '1916-08-11', 'nationality': 'Belgian'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '14', 'laps': '38', 'status': '+4 Laps'}, {'number': '40', 'position': '11', 'positionText': '11', 'points': '0', 'Driver': {'driverId': 'branca', 'url': 'http://en.wikipedia.org/wiki/Toni_Branca', 'givenName': 'Toni', 'familyName': 'Branca', 'dateOfBirth': '1916-09-15', 'nationality': 'Swiss'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '17', 'laps': '35', 'status': '+7 Laps'}, {'number': '14', 'position': '12', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'fangio', 'url': 'http://en.wikipedia.org/wiki/Juan_Manuel_Fangio', 'givenName': 'Juan', 'familyName': 'Fangio', 'dateOfBirth': '1911-06-24', 'nationality': 'Argentine'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '1', 'laps': '32', 'status': 'Engine'}, {'number': '42', 'position': '13', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'etancelin', 'url': 'http://en.wikipedia.org/wiki/Philippe_%C3%89tancelin', 'givenName': 'Philippe', 'familyName': 'Étancelin', 'dateOfBirth': '1896-12-28', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '6', 'laps': '25', 'status': 'Gearbox'}, {'number': '8', 'position': '14', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'martin', 'url': 'http://en.wikipedia.org/wiki/Eug%C3%A8ne_Martin', 'givenName': 'Eugène', 'familyName': 'Martin', 'dateOfBirth': '1915-03-24', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '9', 'laps': '19', 'status': 'Accident'}, {'number': '20', 'position': '15', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'sommer', 'url': 'http://en.wikipedia.org/wiki/Raymond_Sommer', 'givenName': 'Raymond', 'familyName': 'Sommer', 'dateOfBirth': '1906-08-31', 'nationality': 'French'}, 'Constructor': {'constructorId': 'ferrari', 'url': 'http://en.wikipedia.org/wiki/Scuderia_Ferrari', 'name': 'Ferrari', 'nationality': 'Italian'}, 'grid': '13', 'laps': '19', 'status': 'Suspension'}, {'number': '22', 'position': '16', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'villoresi', 'url': 'http://en.wikipedia.org/wiki/Luigi_Villoresi', 'givenName': 'Luigi', 'familyName': 'Villoresi', 'dateOfBirth': '1909-05-16', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'ferrari', 'url': 'http://en.wikipedia.org/wiki/Scuderia_Ferrari', 'name': 'Ferrari', 'nationality': 'Italian'}, 'grid': '4', 'laps': '9', 'status': 'Engine'}, {'number': '18', 'position': '17', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'ascari', 'url': 'http://en.wikipedia.org/wiki/Alberto_Ascari', 'givenName': 'Alberto', 'familyName': 'Ascari', 'dateOfBirth': '1918-07-13', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'ferrari', 'url': 'http://en.wikipedia.org/wiki/Scuderia_Ferrari', 'name': 'Ferrari', 'nationality': 'Italian'}, 'grid': '5', 'laps': '4', 'status': 'Oil pump'}, {'number': '6', 'position': '18', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'cabantous', 'url': 'http://en.wikipedia.org/wiki/Yves_Giraud_Cabantous', 'givenName': 'Yves', 'familyName': 'Cabantous', 'dateOfBirth': '1904-10-08', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '7', 'laps': '0', 'status': 'Accident'}]
919                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [{'number': '10', 'position': '1', 'positionText': '1', 'points': '8', 'Driver': {'driverId': 'fangio', 'url': 'http://en.wikipedia.org/wiki/Juan_Manuel_Fangio', 'givenName': 'Juan', 'familyName': 'Fangio', 'dateOfBirth': '1911-06-24', 'nationality': 'Argentine'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '2', 'laps': '35', 'status': 'Finished', 'Time': {'millis': '10046000', 'time': '2:47:26.0'}}, {'number': '12', 'position': '2', 'positionText': '2', 'points': '6', 'Driver': {'driverId': 'fagioli', 'url': 'http://en.wikipedia.org/wiki/Luigi_Fagioli', 'givenName': 'Luigi', 'familyName': 'Fagioli', 'dateOfBirth': '1898-06-09', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '3', 'laps': '35', 'status': 'Finished', 'Time': {'millis': '10060000', 'time': '+14.0'}}, {'number': '14', 'position': '3', 'positionText': '3', 'points': '4', 'Driver': {'driverId': 'rosier', 'url': 'http://en.wikipedia.org/wiki/Louis_Rosier', 'givenName': 'Louis', 'familyName': 'Rosier', 'dateOfBirth': '1905-11-05', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '8', 'laps': '35', 'status': 'Finished', 'Time': {'millis': '10185000', 'time': '+2:19.0'}}, {'number': '8', 'position': '4', 'positionText': '4', 'points': '4', 'Driver': {'driverId': 'farina', 'url': 'http://en.wikipedia.org/wiki/Nino_Farina', 'givenName': 'Nino', 'familyName': 'Farina', 'dateOfBirth': '1906-10-30', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '1', 'laps': '35', 'status': 'Finished', 'Time': {'millis': '10291000', 'time': '+4:05.0'}}, {'number': '4', 'position': '5', 'positionText': '5', 'points': '2', 'Driver': {'driverId': 'ascari', 'url': 'http://en.wikipedia.org/wiki/Alberto_Ascari', 'givenName': 'Alberto', 'familyName': 'Ascari', 'dateOfBirth': '1918-07-13', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'ferrari', 'url': 'http://en.wikipedia.org/wiki/Scuderia_Ferrari', 'name': 'Ferrari', 'nationality': 'Italian'}, 'grid': '7', 'laps': '34', 'status': '+1 Lap'}, {'number': '2', 'position': '6', 'positionText': '6', 'points': '0', 'Driver': {'driverId': 'villoresi', 'url': 'http://en.wikipedia.org/wiki/Luigi_Villoresi', 'givenName': 'Luigi', 'familyName': 'Villoresi', 'dateOfBirth': '1909-05-16', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'ferrari', 'url': 'http://en.wikipedia.org/wiki/Scuderia_Ferrari', 'name': 'Ferrari', 'nationality': 'Italian'}, 'grid': '4', 'laps': '33', 'status': '+2 Laps'}, {'number': '22', 'position': '7', 'positionText': '7', 'points': '0', 'Driver': {'driverId': 'levegh', 'url': 'http://en.wikipedia.org/wiki/Pierre_Levegh', 'givenName': 'Pierre', 'familyName': 'Levegh', 'dateOfBirth': '1905-12-22', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '10', 'laps': '33', 'status': '+2 Laps'}, {'number': '24', 'position': '8', 'positionText': '8', 'points': '0', 'Driver': {'driverId': 'claes', 'url': 'http://en.wikipedia.org/wiki/Johnny_Claes', 'givenName': 'Johnny', 'familyName': 'Claes', 'dateOfBirth': '1916-08-11', 'nationality': 'Belgian'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '14', 'laps': '22', 'status': '+3 Laps'}, {'number': '26', 'position': '9', 'positionText': '9', 'points': '0', 'Driver': {'driverId': 'crossley', 'url': 'http://en.wikipedia.org/wiki/Geoff_Crossley', 'givenName': 'Geoff', 'familyName': 'Crossley', 'dateOfBirth': '1921-05-11', 'nationality': 'British'}, 'Constructor': {'constructorId': 'alta', 'url': 'http://en.wikipedia.org/wiki/Alta_auto_racing_team', 'name': 'Alta', 'nationality': 'British'}, 'grid': '12', 'laps': '30', 'status': '+5 Laps'}, {'number': '30', 'position': '10', 'positionText': '10', 'points': '0', 'Driver': {'driverId': 'branca', 'url': 'http://en.wikipedia.org/wiki/Toni_Branca', 'givenName': 'Toni', 'familyName': 'Branca', 'dateOfBirth': '1916-09-15', 'nationality': 'Swiss'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '11', 'laps': '29', 'status': '+6 Laps'}, {'number': '20', 'position': '11', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'chaboud', 'url': 'http://en.wikipedia.org/wiki/Eug%C3%A8ne_Chaboud', 'givenName': 'Eugène', 'familyName': 'Chaboud', 'dateOfBirth': '1907-04-12', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '13', 'laps': '22', 'status': 'Oil pipe'}, {'number': '6', 'position': '12', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'sommer', 'url': 'http://en.wikipedia.org/wiki/Raymond_Sommer', 'givenName': 'Raymond', 'familyName': 'Sommer', 'dateOfBirth': '1906-08-31', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '5', 'laps': '20', 'status': 'Oil pressure'}, {'number': '16', 'position': '13', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'etancelin', 'url': 'http://en.wikipedia.org/wiki/Philippe_%C3%89tancelin', 'givenName': 'Philippe', 'familyName': 'Étancelin', 'dateOfBirth': '1896-12-28', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '6', 'laps': '15', 'status': 'Overheating'}, {'number': '18', 'position': '14', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'cabantous', 'url': 'http://en.wikipedia.org/wiki/Yves_Giraud_Cabantous', 'givenName': 'Yves', 'familyName': 'Cabantous', 'dateOfBirth': '1904-10-08', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '9', 'laps': '2', 'status': 'Oil pipe'}]
731                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   [{'number': '6', 'position': '1', 'positionText': '1', 'points': '9', 'Driver': {'driverId': 'fangio', 'url': 'http://en.wikipedia.org/wiki/Juan_Manuel_Fangio', 'givenName': 'Juan', 'familyName': 'Fangio', 'dateOfBirth': '1911-06-24', 'nationality': 'Argentine'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '1', 'laps': '64', 'status': 'Finished', 'Time': {'millis': '10672800', 'time': '2:57:52.8'}}, {'number': '4', 'position': '2', 'positionText': '2', 'points': '6', 'Driver': {'driverId': 'fagioli', 'url': 'http://en.wikipedia.org/wiki/Luigi_Fagioli', 'givenName': 'Luigi', 'familyName': 'Fagioli', 'dateOfBirth': '1898-06-09', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '3', 'laps': '64', 'status': 'Finished', 'Time': {'millis': '10698500', 'time': '+25.7'}}, {'number': '14', 'position': '3', 'positionText': '3', 'points': '4', 'Driver': {'driverId': 'whitehead', 'url': 'http://en.wikipedia.org/wiki/Peter_Whitehead_(racing_driver)', 'givenName': 'Peter', 'familyName': 'Whitehead', 'dateOfBirth': '1914-11-12', 'nationality': 'British'}, 'Constructor': {'constructorId': 'ferrari', 'url': 'http://en.wikipedia.org/wiki/Scuderia_Ferrari', 'name': 'Ferrari', 'nationality': 'Italian'}, 'grid': '18', 'laps': '61', 'status': '+3 Laps'}, {'number': '44', 'position': '4', 'positionText': '4', 'points': '3', 'Driver': {'driverId': 'manzon', 'url': 'http://en.wikipedia.org/wiki/Robert_Manzon', 'givenName': 'Robert', 'familyName': 'Manzon', 'dateOfBirth': '1917-04-12', 'nationality': 'French'}, 'Constructor': {'constructorId': 'simca', 'url': 'http://en.wikipedia.org/wiki/Simca', 'name': 'Simca', 'nationality': 'French'}, 'grid': '12', 'laps': '61', 'status': '+3 Laps'}, {'number': '16', 'position': '5', 'positionText': '5', 'points': '1', 'Driver': {'driverId': 'etancelin', 'url': 'http://en.wikipedia.org/wiki/Philippe_%C3%89tancelin', 'givenName': 'Philippe', 'familyName': 'Étancelin', 'dateOfBirth': '1896-12-28', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '4', 'laps': '59', 'status': '+5 Laps'}, {'number': '16', 'position': '5', 'positionText': '5', 'points': '1', 'Driver': {'driverId': 'chaboud', 'url': 'http://en.wikipedia.org/wiki/Eug%C3%A8ne_Chaboud', 'givenName': 'Eugène', 'familyName': 'Chaboud', 'dateOfBirth': '1907-04-12', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '4', 'laps': '59', 'status': '+5 Laps'}, {'number': '26', 'position': '6', 'positionText': '6', 'points': '0', 'Driver': {'driverId': 'pozzi', 'url': 'http://en.wikipedia.org/wiki/Charles_Pozzi', 'givenName': 'Charles', 'familyName': 'Pozzi', 'dateOfBirth': '1909-08-27', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '15', 'laps': '56', 'status': '+8 Laps'}, {'number': '26', 'position': '6', 'positionText': '6', 'points': '0', 'Driver': {'driverId': 'rosier', 'url': 'http://en.wikipedia.org/wiki/Louis_Rosier', 'givenName': 'Louis', 'familyName': 'Rosier', 'dateOfBirth': '1905-11-05', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '15', 'laps': '56', 'status': '+8 Laps'}, {'number': '2', 'position': '7', 'positionText': '7', 'points': '0', 'Driver': {'driverId': 'farina', 'url': 'http://en.wikipedia.org/wiki/Nino_Farina', 'givenName': 'Nino', 'familyName': 'Farina', 'dateOfBirth': '1906-10-30', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'alfa', 'url': 'http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One', 'name': 'Alfa Romeo', 'nationality': 'Swiss'}, 'grid': '2', 'laps': '55', 'status': 'Fuel pump'}, {'number': '18', 'position': '8', 'positionText': '8', 'points': '0', 'Driver': {'driverId': 'cabantous', 'url': 'http://en.wikipedia.org/wiki/Yves_Giraud_Cabantous', 'givenName': 'Yves', 'familyName': 'Cabantous', 'dateOfBirth': '1904-10-08', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '5', 'laps': '52', 'status': '+12 Laps'}, {'number': '22', 'position': '9', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'levegh', 'url': 'http://en.wikipedia.org/wiki/Pierre_Levegh', 'givenName': 'Pierre', 'familyName': 'Levegh', 'dateOfBirth': '1905-12-22', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '9', 'laps': '36', 'status': 'Engine'}, {'number': '40', 'position': '10', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'bonetto', 'url': 'http://en.wikipedia.org/wiki/Felice_Bonetto', 'givenName': 'Felice', 'familyName': 'Bonetto', 'dateOfBirth': '1903-06-09', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '10', 'laps': '14', 'status': 'Engine'}, {'number': '42', 'position': '11', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'claes', 'url': 'http://en.wikipedia.org/wiki/Johnny_Claes', 'givenName': 'Johnny', 'familyName': 'Claes', 'dateOfBirth': '1916-08-11', 'nationality': 'Belgian'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '14', 'laps': '11', 'status': 'Overheating'}, {'number': '20', 'position': '12', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'rosier', 'url': 'http://en.wikipedia.org/wiki/Louis_Rosier', 'givenName': 'Louis', 'familyName': 'Rosier', 'dateOfBirth': '1905-11-05', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '6', 'laps': '10', 'status': 'Overheating'}, {'number': '32', 'position': '13', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'reg_parnell', 'url': 'http://en.wikipedia.org/wiki/Reg_Parnell', 'givenName': 'Reg', 'familyName': 'Parnell', 'dateOfBirth': '1911-07-02', 'nationality': 'British'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '11', 'laps': '9', 'status': 'Engine'}, {'number': '28', 'position': '14', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'rol', 'url': 'http://en.wikipedia.org/wiki/Franco_Rol', 'givenName': 'Franco', 'familyName': 'Rol', 'dateOfBirth': '1908-06-05', 'nationality': 'Italian'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '7', 'laps': '6', 'status': 'Engine'}, {'number': '30', 'position': '15', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'chiron', 'url': 'http://en.wikipedia.org/wiki/Louis_Chiron', 'givenName': 'Louis', 'familyName': 'Chiron', 'dateOfBirth': '1899-08-03', 'nationality': 'Monegasque'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '13', 'laps': '6', 'status': 'Engine'}, {'number': '34', 'position': '16', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'hampshire', 'url': 'http://en.wikipedia.org/wiki/David_Hampshire', 'givenName': 'David', 'familyName': 'Hampshire', 'dateOfBirth': '1917-12-29', 'nationality': 'British'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '17', 'laps': '5', 'status': 'Engine'}, {'number': '12', 'position': '17', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'sommer', 'url': 'http://en.wikipedia.org/wiki/Raymond_Sommer', 'givenName': 'Raymond', 'familyName': 'Sommer', 'dateOfBirth': '1906-08-31', 'nationality': 'French'}, 'Constructor': {'constructorId': 'lago', 'url': 'http://en.wikipedia.org/wiki/Talbot-Lago', 'name': 'Talbot-Lago', 'nationality': 'French'}, 'grid': '16', 'laps': '4', 'status': 'Overheating'}, {'number': '36', 'position': '18', 'positionText': 'R', 'points': '0', 'Driver': {'driverId': 'gonzalez', 'url': 'http://en.wikipedia.org/wiki/Jos%C3%A9_Froil%C3%A1n_Gonz%C3%A1lez', 'givenName': 'José Froilán', 'familyName': 'González', 'dateOfBirth': '1922-10-05', 'nationality': 'Argentine'}, 'Constructor': {'constructorId': 'maserati', 'url': 'http://en.wikipedia.org/wiki/Maserati', 'name': 'Maserati', 'nationality': 'Italian'}, 'grid': '8', 'laps': '3', 'status': 'Engine'}]
    time                  circuitName
812 <NA>          Silverstone Circuit
497 <NA>            Circuit de Monaco
326 <NA>  Indianapolis Motor Speedway
102 <NA>           Circuit Bremgarten
919 <NA> Circuit de Spa-Francorchamps
731 <NA>                  Reims-Gueux
                                                                                 Location
812    {'lat': '52.0786', 'long': '-1.01694', 'locality': 'Silverstone', 'country': 'UK'}
497 {'lat': '43.7347', 'long': '7.42056', 'locality': 'Monte-Carlo', 'country': 'Monaco'}
326   {'lat': '39.795', 'long': '-86.2347', 'locality': 'Indianapolis', 'country': 'USA'}
102   {'lat': '46.9589', 'long': '7.40194', 'locality': 'Bern', 'country': 'Switzerland'}
919        {'lat': '50.4372', 'long': '5.97139', 'locality': 'Spa', 'country': 'Belgium'}
731       {'lat': '49.2542', 'long': '3.93083', 'locality': 'Reims', 'country': 'France'}
Code
head(driver_df)
# A tibble: 6 × 9
  driverId driverRef  number code  forename surname    dob        nation…¹ url  
     <dbl> <chr>      <chr>  <chr> <chr>    <chr>      <date>     <chr>    <chr>
1        1 hamilton   "44"   HAM   Lewis    Hamilton   1985-01-07 British  http…
2        2 heidfeld   "\\N"  HEI   Nick     Heidfeld   1977-05-10 German   http…
3        3 rosberg    "6"    ROS   Nico     Rosberg    1985-06-27 German   http…
4        4 alonso     "14"   ALO   Fernando Alonso     1981-07-29 Spanish  http…
5        5 kovalainen "\\N"  KOV   Heikki   Kovalainen 1981-10-19 Finnish  http…
6        6 nakajima   "\\N"  NAK   Kazuki   Nakajima   1985-01-11 Japanese http…
# … with abbreviated variable name ¹​nationality

Unzipping Dictionaries from Race results column:

Code
df$Results_Position_1 =  word(df$Results,1,sep = fixed(", {'number'"))
df$Results_Position_2 =  word(df$Results,2,sep = fixed(", {'number'"))
df$Results_Position_3 =  word(df$Results,3,sep = fixed(", {'number'"))
df$Results_Position_4 =  word(df$Results,4,sep = fixed(", {'number'"))
df$Results_Position_5 =  word(df$Results,5,sep = fixed(", {'number'"))
Code
df$Driver_Position_1 = word(df$Results_Position_1,2,sep = fixed(","))
df$Driver_Position_2 = word(df$Results_Position_2,2,sep = fixed(","))
df$Driver_Position_3 = word(df$Results_Position_3,2,sep = fixed(","))
df$Driver_Position_4 = word(df$Results_Position_4,2,sep = fixed(","))
df$Driver_Position_5 = word(df$Results_Position_5,2,sep = fixed(","))

df$Driver_Position_1 = word(df$Driver_Position_1,2,sep = fixed(": "))
df$Driver_Position_2 = word(df$Driver_Position_2,2,sep = fixed(": "))
df$Driver_Position_3 = word(df$Driver_Position_3,2,sep = fixed(": "))
df$Driver_Position_4 = word(df$Driver_Position_4,2,sep = fixed(": "))
df$Driver_Position_5 = word(df$Driver_Position_5,2,sep = fixed(": "))

df$Driver_Points_1 = word(df$Results_Position_1,4,sep = fixed(","))
df$Driver_Points_2 = word(df$Results_Position_2,4,sep = fixed(","))
df$Driver_Points_3 = word(df$Results_Position_3,4,sep = fixed(","))
df$Driver_Points_4 = word(df$Results_Position_4,4,sep = fixed(","))
df$Driver_Points_5 = word(df$Results_Position_5,4,sep = fixed(","))

df$Driver_Points_1 = word(df$Driver_Points_1,2,sep = fixed(": "))
df$Driver_Points_2 = word(df$Driver_Points_2,2,sep = fixed(": "))
df$Driver_Points_3 = word(df$Driver_Points_3,2,sep = fixed(": "))
df$Driver_Points_4 = word(df$Driver_Points_4,2,sep = fixed(": "))
df$Driver_Points_5 = word(df$Driver_Points_5,2,sep = fixed(": "))

df$Driver_Info_1 = word(df$Results_Position_1,2,sep = fixed("'Driver': {"))
df$Driver_Info_2 = word(df$Results_Position_2,2,sep = fixed("'Driver': {"))
df$Driver_Info_3 = word(df$Results_Position_3,2,sep = fixed("'Driver': {"))
df$Driver_Info_4 = word(df$Results_Position_4,2,sep = fixed("'Driver': {"))
df$Driver_Info_5 = word(df$Results_Position_5,2,sep = fixed("'Driver': {"))

df$driverRef_1 = word(df$Driver_Info_1,1,sep = fixed(","))
df$driverRef_2 = word(df$Driver_Info_2,1,sep = fixed(","))
df$driverRef_3 = word(df$Driver_Info_3,1,sep = fixed(","))
df$driverRef_4 = word(df$Driver_Info_4,1,sep = fixed(","))
df$driverRef_5 = word(df$Driver_Info_5,1,sep = fixed(","))

df$driverRef_1 = word(df$driverRef_1,2,sep = fixed(": "))
df$driverRef_2 = word(df$driverRef_2,2,sep = fixed(": "))
df$driverRef_3 = word(df$driverRef_3,2,sep = fixed(": "))
df$driverRef_4 = word(df$driverRef_4,2,sep = fixed(": "))
df$driverRef_5 = word(df$driverRef_5,2,sep = fixed(": "))

df$Constructor_Info_1 = word(df$Results_Position_1,2,sep = fixed("'Constructor': {"))
df$Constructor_Info_2 = word(df$Results_Position_2,2,sep = fixed("'Constructor': {"))
df$Constructor_Info_3 = word(df$Results_Position_3,2,sep = fixed("'Constructor': {"))
df$Constructor_Info_4 = word(df$Results_Position_4,2,sep = fixed("'Constructor': {"))
df$Constructor_Info_5 = word(df$Results_Position_5,2,sep = fixed("'Constructor': {"))

df$constructorRef_1 = word(df$Constructor_Info_1,1,sep = fixed(","))
df$constructorRef_2 = word(df$Constructor_Info_2,1,sep = fixed(","))
df$constructorRef_3 = word(df$Constructor_Info_3,1,sep = fixed(","))
df$constructorRef_4 = word(df$Constructor_Info_4,1,sep = fixed(","))
df$constructorRef_5 = word(df$Constructor_Info_5,1,sep = fixed(","))

df$constructorRef_1 = word(df$constructorRef_1,2,sep = fixed(": "))
df$constructorRef_2 = word(df$constructorRef_2,2,sep = fixed(": "))
df$constructorRef_3 = word(df$constructorRef_3,2,sep = fixed(": "))
df$constructorRef_4 = word(df$constructorRef_4,2,sep = fixed(": "))
df$constructorRef_5 = word(df$constructorRef_5,2,sep = fixed(": "))

df$otherinfo_1 = word(df$Results_Position_1,2,sep = fixed("'grid'"))
df$otherinfo_2 = word(df$Results_Position_2,2,sep = fixed("'grid'"))
df$otherinfo_3 = word(df$Results_Position_3,2,sep = fixed("'grid'"))
df$otherinfo_4 = word(df$Results_Position_4,2,sep = fixed("'grid'"))
df$otherinfo_5 = word(df$Results_Position_5,2,sep = fixed("'grid'"))

df$grid_pos_1 = word(df$otherinfo_1,1,sep = fixed(","))
df$grid_pos_2 = word(df$otherinfo_2,1,sep = fixed(","))
df$grid_pos_3 = word(df$otherinfo_3,1,sep = fixed(","))
df$grid_pos_4 = word(df$otherinfo_4,1,sep = fixed(","))
df$grid_pos_5 = word(df$otherinfo_5,1,sep = fixed(","))

df$completed_laps_1 = word(df$otherinfo_1,2,sep = fixed(","))
df$completed_laps_2 = word(df$otherinfo_2,2,sep = fixed(","))
df$completed_laps_3 = word(df$otherinfo_3,2,sep = fixed(","))
df$completed_laps_4 = word(df$otherinfo_4,2,sep = fixed(","))
df$completed_laps_5 = word(df$otherinfo_5,2,sep = fixed(","))

df$race_status_1 = word(df$otherinfo_1,3,sep = fixed(","))
df$race_status_2 = word(df$otherinfo_2,3,sep = fixed(","))
df$race_status_3 = word(df$otherinfo_3,3,sep = fixed(","))
df$race_status_4 = word(df$otherinfo_4,3,sep = fixed(","))
df$race_status_5 = word(df$otherinfo_5,3,sep = fixed(","))

df$race_time_1 = word(df$otherinfo_1,2,sep = fixed("'Time':"))
df$race_time_2 = word(df$otherinfo_2,2,sep = fixed("'Time':"))
df$race_time_3 = word(df$otherinfo_3,2,sep = fixed("'Time':"))
df$race_time_4 = word(df$otherinfo_4,2,sep = fixed("'Time':"))
df$race_time_5 = word(df$otherinfo_5,2,sep = fixed("'Time':"))

df$grid_pos_1 = word(df$grid_pos_1,2,sep = fixed(": "))
df$grid_pos_2 = word(df$grid_pos_2,2,sep = fixed(": "))
df$grid_pos_3 = word(df$grid_pos_3,2,sep = fixed(": "))
df$grid_pos_4 = word(df$grid_pos_4,2,sep = fixed(": "))
df$grid_pos_5 = word(df$grid_pos_5,2,sep = fixed(": "))

df$completed_laps_1 = word(df$completed_laps_1,2,sep = fixed(": "))
df$completed_laps_2 = word(df$completed_laps_2,2,sep = fixed(": "))
df$completed_laps_3 = word(df$completed_laps_3,2,sep = fixed(": "))
df$completed_laps_4 = word(df$completed_laps_4,2,sep = fixed(": "))
df$completed_laps_5 = word(df$completed_laps_5,2,sep = fixed(": "))

df$race_status_1 = word(df$race_status_1,2,sep = fixed(": "))
df$race_status_2 = word(df$race_status_2,2,sep = fixed(": "))
df$race_status_3 = word(df$race_status_3,2,sep = fixed(": "))
df$race_status_4 = word(df$race_status_4,2,sep = fixed(": "))
df$race_status_5 = word(df$race_status_5,2,sep = fixed(": "))

Dropping the columns created above:

Code
drop = c("Driver_Info_1", "Driver_Info_2", "Driver_Info_3", "Driver_Info_4", "Driver_Info_5", "Constructor_Info_1", "Constructor_Info_2", "Constructor_Info_3", "Constructor_Info_4", "Constructor_Info_5", "Driver_Info_1", "Driver_Info_1", "Driver_Info_1", "Driver_Info_1", "Driver_Info_1", "Circuit", "Results", "otherinfo_1", "otherinfo_2", "otherinfo_3", "otherinfo_4", "otherinfo_5", "Results_Position_1", "Results_Position_2", "Results_Position_3", "Results_Position_4", "Results_Position_5", "time")
df = df[,!(names(df) %in% drop)]
Code
num_cols = c('Driver_Position_1', 'Driver_Position_2', 'Driver_Position_3', 'Driver_Position_4', 'Driver_Position_5',
             'Driver_Points_1', 'Driver_Points_2', 'Driver_Points_3', 'Driver_Points_4', 'Driver_Points_5',
             'grid_pos_1', 'grid_pos_2', 'grid_pos_3', 'grid_pos_4', 'grid_pos_5', 
             'completed_laps_1', 'completed_laps_2', 'completed_laps_3', 'completed_laps_4', 'completed_laps_5')
Code
fn <- function(x) gsub("'", "", x)
fncol <- colwise(fn, .cols=num_cols)
df[, num_cols] = fncol(df)

Converting columns to numeric:

Code
df[num_cols] = sapply(df[num_cols], as.numeric)
Code
colnames(df)
 [1] "circuitId"         "season"            "round"            
 [4] "raceName"          "date"              "circuitName"      
 [7] "Location"          "Driver_Position_1" "Driver_Position_2"
[10] "Driver_Position_3" "Driver_Position_4" "Driver_Position_5"
[13] "Driver_Points_1"   "Driver_Points_2"   "Driver_Points_3"  
[16] "Driver_Points_4"   "Driver_Points_5"   "driverRef_1"      
[19] "driverRef_2"       "driverRef_3"       "driverRef_4"      
[22] "driverRef_5"       "constructorRef_1"  "constructorRef_2" 
[25] "constructorRef_3"  "constructorRef_4"  "constructorRef_5" 
[28] "grid_pos_1"        "grid_pos_2"        "grid_pos_3"       
[31] "grid_pos_4"        "grid_pos_5"        "completed_laps_1" 
[34] "completed_laps_2"  "completed_laps_3"  "completed_laps_4" 
[37] "completed_laps_5"  "race_status_1"     "race_status_2"    
[40] "race_status_3"     "race_status_4"     "race_status_5"    
[43] "race_time_1"       "race_time_2"       "race_time_3"      
[46] "race_time_4"       "race_time_5"      
Code
df2 = df[rep(seq_len(nrow(df)), each = 5), ]
rownames(df2) <- 1:nrow(df2)
head(df2)
    circuitId season round           raceName       date         circuitName
1 silverstone   1950     1 British Grand Prix 1950-05-13 Silverstone Circuit
2 silverstone   1950     1 British Grand Prix 1950-05-13 Silverstone Circuit
3 silverstone   1950     1 British Grand Prix 1950-05-13 Silverstone Circuit
4 silverstone   1950     1 British Grand Prix 1950-05-13 Silverstone Circuit
5 silverstone   1950     1 British Grand Prix 1950-05-13 Silverstone Circuit
6      monaco   1950     2  Monaco Grand Prix 1950-05-21   Circuit de Monaco
                                                                               Location
1    {'lat': '52.0786', 'long': '-1.01694', 'locality': 'Silverstone', 'country': 'UK'}
2    {'lat': '52.0786', 'long': '-1.01694', 'locality': 'Silverstone', 'country': 'UK'}
3    {'lat': '52.0786', 'long': '-1.01694', 'locality': 'Silverstone', 'country': 'UK'}
4    {'lat': '52.0786', 'long': '-1.01694', 'locality': 'Silverstone', 'country': 'UK'}
5    {'lat': '52.0786', 'long': '-1.01694', 'locality': 'Silverstone', 'country': 'UK'}
6 {'lat': '43.7347', 'long': '7.42056', 'locality': 'Monte-Carlo', 'country': 'Monaco'}
  Driver_Position_1 Driver_Position_2 Driver_Position_3 Driver_Position_4
1                 1                 2                 3                 4
2                 1                 2                 3                 4
3                 1                 2                 3                 4
4                 1                 2                 3                 4
5                 1                 2                 3                 4
6                 1                 2                 3                 4
  Driver_Position_5 Driver_Points_1 Driver_Points_2 Driver_Points_3
1                 5               9               6               4
2                 5               9               6               4
3                 5               9               6               4
4                 5               9               6               4
5                 5               9               6               4
6                 5               9               6               4
  Driver_Points_4 Driver_Points_5 driverRef_1 driverRef_2   driverRef_3
1               3               2    'farina'   'fagioli' 'reg_parnell'
2               3               2    'farina'   'fagioli' 'reg_parnell'
3               3               2    'farina'   'fagioli' 'reg_parnell'
4               3               2    'farina'   'fagioli' 'reg_parnell'
5               3               2    'farina'   'fagioli' 'reg_parnell'
6               3               2    'fangio'    'ascari'      'chiron'
  driverRef_4 driverRef_5 constructorRef_1 constructorRef_2 constructorRef_3
1 'cabantous'    'rosier'           'alfa'           'alfa'           'alfa'
2 'cabantous'    'rosier'           'alfa'           'alfa'           'alfa'
3 'cabantous'    'rosier'           'alfa'           'alfa'           'alfa'
4 'cabantous'    'rosier'           'alfa'           'alfa'           'alfa'
5 'cabantous'    'rosier'           'alfa'           'alfa'           'alfa'
6    'sommer'      'bira'           'alfa'        'ferrari'       'maserati'
  constructorRef_4 constructorRef_5 grid_pos_1 grid_pos_2 grid_pos_3 grid_pos_4
1           'lago'           'lago'          1          2          4          6
2           'lago'           'lago'          1          2          4          6
3           'lago'           'lago'          1          2          4          6
4           'lago'           'lago'          1          2          4          6
5           'lago'           'lago'          1          2          4          6
6        'ferrari'       'maserati'          1          7          8          9
  grid_pos_5 completed_laps_1 completed_laps_2 completed_laps_3
1          9               70               70               70
2          9               70               70               70
3          9               70               70               70
4          9               70               70               70
5          9               70               70               70
6         15              100               99               98
  completed_laps_4 completed_laps_5 race_status_1 race_status_2 race_status_3
1               68               68    'Finished'    'Finished'    'Finished'
2               68               68    'Finished'    'Finished'    'Finished'
3               68               68    'Finished'    'Finished'    'Finished'
4               68               68    'Finished'    'Finished'    'Finished'
5               68               68    'Finished'    'Finished'    'Finished'
6               97               95    'Finished'     '+1 Lap'}    '+2 Laps'}
  race_status_4 race_status_5                                   race_time_1
1    '+2 Laps'}    '+2 Laps'}   {'millis': '8003600', 'time': '2:13:23.6'}}
2    '+2 Laps'}    '+2 Laps'}   {'millis': '8003600', 'time': '2:13:23.6'}}
3    '+2 Laps'}    '+2 Laps'}   {'millis': '8003600', 'time': '2:13:23.6'}}
4    '+2 Laps'}    '+2 Laps'}   {'millis': '8003600', 'time': '2:13:23.6'}}
5    '+2 Laps'}    '+2 Laps'}   {'millis': '8003600', 'time': '2:13:23.6'}}
6    '+3 Laps'}    '+5 Laps'}  {'millis': '11598700', 'time': '3:13:18.7'}}
                              race_time_2
1  {'millis': '8006200', 'time': '+2.6'}}
2  {'millis': '8006200', 'time': '+2.6'}}
3  {'millis': '8006200', 'time': '+2.6'}}
4  {'millis': '8006200', 'time': '+2.6'}}
5  {'millis': '8006200', 'time': '+2.6'}}
6                                    <NA>
                               race_time_3 race_time_4 race_time_5
1  {'millis': '8055600', 'time': '+52.0'}}        <NA>        <NA>
2  {'millis': '8055600', 'time': '+52.0'}}        <NA>        <NA>
3  {'millis': '8055600', 'time': '+52.0'}}        <NA>        <NA>
4  {'millis': '8055600', 'time': '+52.0'}}        <NA>        <NA>
5  {'millis': '8055600', 'time': '+52.0'}}        <NA>        <NA>
6                                     <NA>        <NA>        <NA>

Exporting the CSV for further cleaning:

Code
write_csv(df2, '../../data/01-modified-data/data_cleaning_R.csv', na = '') #to python

To be Continued in Python since R does not support handling dictionaries.

Source Code
---
title: <b>Record Data Cleaning in R</b>
format:
  html:
    theme: lumen
    toc: true
    self-contained: true
    embed-resources: true
    page-layout: full
    code-fold: true
    code-tools: true
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, warning = FALSE)
```

# Data Cleaning
- In the era of big data, cleaning or scrubbing your data has become an essential part of the data management process. Even though data cleaning can be tedious at times, it is absolutely crucial for getting accurate business intelligence (BI) that can drive your strategic decisions.
- Incorrect or inconsistent data leads to false conclusions. And so, how well you clean and understand the data has a high impact on the quality of the results.
- Data cleaning involve different techniques based on the problem and the data type. Different methods can be applied with each has its own trade-offs. Overall, incorrect data is either removed, corrected, or imputed.
- Data cleaning is the process of removing incorrect, duplicate, or otherwise erroneous data from a dataset. These errors can include incorrectly formatted data, redundant entries, mislabeled data, and other issues; they often arise when two or more datasets are combined together. Data cleaning improves the quality of your data as well as any business decisions that you draw based on the data.
- There is no one right way to clean a dataset, as every set is different and presents its own unique slate of errors that need to be corrected. Many data cleaning techniques can now be automated with the help of dedicated software, but some portion of the work must be done manually to ensure the greatest accuracy. Usually this work is done by data quality analysts, BI analysts, and business users.
- Every organization’s data cleaning methods will vary according to their individual needs as well as the particular constraints of the dataset. However, most data cleaning steps follow a standard framework:
    1. Determine the critical data values you need for your analysis.
    2. Collect the data you need, then sort and organize it.
    3. Identify duplicate or irrelevant values and remove them.
    4. Search for missing values and fill them in, so you have a complete dataset.
    5. Fix any remaining structural or repetitive errors in the dataset.
    6. Identify outliers and remove them, so they will not interfere with your analysis.
    7. Validate your dataset to ensure it is ready for data transformation and analysis.
    8. Once the set has been validated, perform your transformation and analysis.
- Data Cleaning vs. Data Cleansing vs. Data Scrubbing:
  - You might sometimes hear the terms data cleansing or data scrubbing used instead of data cleaning. In most situations, these terms are all being used interchangeably and refer to the exact same thing. Data scrubbing may sometimes be used to refer to a specific aspect of data cleaning—namely, removing duplicate or bad data from datasets.
  - You should also know that data scrubbing can have a slightly different meaning within the specific context of data storage; in this case, it refers to an automated function that evaluates storage systems and disk drives to identify any bad sectors or blocks and to confirm the data in them can be read.
  - Note that all three of these terms—data cleaning, data cleansing, and data scrubbing—are different from data transformation, which is the act of taking clean data and converting it into a new format or structure. Data transformation is a separate process that comes after data cleaning.
- Benefits of Data Cleaning:
  - Not having clean data exacts a high price: IBM estimates that bad data costs the U.S. over $3 trillion each year. That’s because data-driven decisions are only as good as the data you are relying on. Bad quality data leads to equally bad quality decisions. If the data you are basing your strategy on is inaccurate, then your strategy will have the same issues present in the data, even if it seems sound. In fact, sometimes no data at all is better than bad data.
  - Cleaning your data results in many benefits for your organization in both the short- and long-term. It leads to better decision making, which can boost your efficiency and your customer satisfaction, in turn giving your business a competitive edge. Over time, it also reduces your costs of data management by preemptively removing errors and other mistakes that would necessitate performing analysis over and over again.


# Importing Libraries

```{r}
library(tidyr)
library(tidyverse)
library(plyr)
library(stringr)
```

# Importing Data

```{r}
race_df = read_csv("../../data/00-raw-data/race_results.csv")
circuit_df = read_csv("../../data/00-raw-data/circuit_info.csv")
driver_df = read_csv('../../data/00-raw-data/drivers.csv')
```

# Cleaning the Data

Dropping unnecesarry columns:

```{r}
colnames(race_df) = c('index', 'season', 'round', 'url', 'raceName', 'Circuit', 'date', 'Results', 'time')
drop = c("index", "url")
race_df = race_df[,!(names(race_df) %in% drop)]
```

```{r}
colnames(circuit_df) = c('index', 'circuitId', 'url', 'circuitName', 'Location')
drop = c("index", "url")
circuit_df = circuit_df[,!(names(circuit_df) %in% drop)]
```

Removing brackets and apostrophes from the data as it is not needed:

```{r}
race_df = race_df %>% 
  mutate(across('Circuit', str_replace, fixed("{"), ''),
         across('Circuit', str_replace, fixed("}"), ''))
```

```{r}
race_df$circuitId =  word(race_df$Circuit,1,sep = ",")
race_df$circuitId = word(race_df$circuitId,2,sep = ": ")
race_df$circuitId = gsub("'", "", race_df$circuitId)
```

Merging Dataframes:

```{r}
df = merge(race_df, circuit_df, by = 'circuitId', all.x = TRUE)
df = df[order(df$season, df$round), ]
head(df)
```

```{r}
head(driver_df)
```

Unzipping Dictionaries from Race results column:

```{r}
df$Results_Position_1 =  word(df$Results,1,sep = fixed(", {'number'"))
df$Results_Position_2 =  word(df$Results,2,sep = fixed(", {'number'"))
df$Results_Position_3 =  word(df$Results,3,sep = fixed(", {'number'"))
df$Results_Position_4 =  word(df$Results,4,sep = fixed(", {'number'"))
df$Results_Position_5 =  word(df$Results,5,sep = fixed(", {'number'"))
```

```{r}
df$Driver_Position_1 = word(df$Results_Position_1,2,sep = fixed(","))
df$Driver_Position_2 = word(df$Results_Position_2,2,sep = fixed(","))
df$Driver_Position_3 = word(df$Results_Position_3,2,sep = fixed(","))
df$Driver_Position_4 = word(df$Results_Position_4,2,sep = fixed(","))
df$Driver_Position_5 = word(df$Results_Position_5,2,sep = fixed(","))

df$Driver_Position_1 = word(df$Driver_Position_1,2,sep = fixed(": "))
df$Driver_Position_2 = word(df$Driver_Position_2,2,sep = fixed(": "))
df$Driver_Position_3 = word(df$Driver_Position_3,2,sep = fixed(": "))
df$Driver_Position_4 = word(df$Driver_Position_4,2,sep = fixed(": "))
df$Driver_Position_5 = word(df$Driver_Position_5,2,sep = fixed(": "))

df$Driver_Points_1 = word(df$Results_Position_1,4,sep = fixed(","))
df$Driver_Points_2 = word(df$Results_Position_2,4,sep = fixed(","))
df$Driver_Points_3 = word(df$Results_Position_3,4,sep = fixed(","))
df$Driver_Points_4 = word(df$Results_Position_4,4,sep = fixed(","))
df$Driver_Points_5 = word(df$Results_Position_5,4,sep = fixed(","))

df$Driver_Points_1 = word(df$Driver_Points_1,2,sep = fixed(": "))
df$Driver_Points_2 = word(df$Driver_Points_2,2,sep = fixed(": "))
df$Driver_Points_3 = word(df$Driver_Points_3,2,sep = fixed(": "))
df$Driver_Points_4 = word(df$Driver_Points_4,2,sep = fixed(": "))
df$Driver_Points_5 = word(df$Driver_Points_5,2,sep = fixed(": "))

df$Driver_Info_1 = word(df$Results_Position_1,2,sep = fixed("'Driver': {"))
df$Driver_Info_2 = word(df$Results_Position_2,2,sep = fixed("'Driver': {"))
df$Driver_Info_3 = word(df$Results_Position_3,2,sep = fixed("'Driver': {"))
df$Driver_Info_4 = word(df$Results_Position_4,2,sep = fixed("'Driver': {"))
df$Driver_Info_5 = word(df$Results_Position_5,2,sep = fixed("'Driver': {"))

df$driverRef_1 = word(df$Driver_Info_1,1,sep = fixed(","))
df$driverRef_2 = word(df$Driver_Info_2,1,sep = fixed(","))
df$driverRef_3 = word(df$Driver_Info_3,1,sep = fixed(","))
df$driverRef_4 = word(df$Driver_Info_4,1,sep = fixed(","))
df$driverRef_5 = word(df$Driver_Info_5,1,sep = fixed(","))

df$driverRef_1 = word(df$driverRef_1,2,sep = fixed(": "))
df$driverRef_2 = word(df$driverRef_2,2,sep = fixed(": "))
df$driverRef_3 = word(df$driverRef_3,2,sep = fixed(": "))
df$driverRef_4 = word(df$driverRef_4,2,sep = fixed(": "))
df$driverRef_5 = word(df$driverRef_5,2,sep = fixed(": "))

df$Constructor_Info_1 = word(df$Results_Position_1,2,sep = fixed("'Constructor': {"))
df$Constructor_Info_2 = word(df$Results_Position_2,2,sep = fixed("'Constructor': {"))
df$Constructor_Info_3 = word(df$Results_Position_3,2,sep = fixed("'Constructor': {"))
df$Constructor_Info_4 = word(df$Results_Position_4,2,sep = fixed("'Constructor': {"))
df$Constructor_Info_5 = word(df$Results_Position_5,2,sep = fixed("'Constructor': {"))

df$constructorRef_1 = word(df$Constructor_Info_1,1,sep = fixed(","))
df$constructorRef_2 = word(df$Constructor_Info_2,1,sep = fixed(","))
df$constructorRef_3 = word(df$Constructor_Info_3,1,sep = fixed(","))
df$constructorRef_4 = word(df$Constructor_Info_4,1,sep = fixed(","))
df$constructorRef_5 = word(df$Constructor_Info_5,1,sep = fixed(","))

df$constructorRef_1 = word(df$constructorRef_1,2,sep = fixed(": "))
df$constructorRef_2 = word(df$constructorRef_2,2,sep = fixed(": "))
df$constructorRef_3 = word(df$constructorRef_3,2,sep = fixed(": "))
df$constructorRef_4 = word(df$constructorRef_4,2,sep = fixed(": "))
df$constructorRef_5 = word(df$constructorRef_5,2,sep = fixed(": "))

df$otherinfo_1 = word(df$Results_Position_1,2,sep = fixed("'grid'"))
df$otherinfo_2 = word(df$Results_Position_2,2,sep = fixed("'grid'"))
df$otherinfo_3 = word(df$Results_Position_3,2,sep = fixed("'grid'"))
df$otherinfo_4 = word(df$Results_Position_4,2,sep = fixed("'grid'"))
df$otherinfo_5 = word(df$Results_Position_5,2,sep = fixed("'grid'"))

df$grid_pos_1 = word(df$otherinfo_1,1,sep = fixed(","))
df$grid_pos_2 = word(df$otherinfo_2,1,sep = fixed(","))
df$grid_pos_3 = word(df$otherinfo_3,1,sep = fixed(","))
df$grid_pos_4 = word(df$otherinfo_4,1,sep = fixed(","))
df$grid_pos_5 = word(df$otherinfo_5,1,sep = fixed(","))

df$completed_laps_1 = word(df$otherinfo_1,2,sep = fixed(","))
df$completed_laps_2 = word(df$otherinfo_2,2,sep = fixed(","))
df$completed_laps_3 = word(df$otherinfo_3,2,sep = fixed(","))
df$completed_laps_4 = word(df$otherinfo_4,2,sep = fixed(","))
df$completed_laps_5 = word(df$otherinfo_5,2,sep = fixed(","))

df$race_status_1 = word(df$otherinfo_1,3,sep = fixed(","))
df$race_status_2 = word(df$otherinfo_2,3,sep = fixed(","))
df$race_status_3 = word(df$otherinfo_3,3,sep = fixed(","))
df$race_status_4 = word(df$otherinfo_4,3,sep = fixed(","))
df$race_status_5 = word(df$otherinfo_5,3,sep = fixed(","))

df$race_time_1 = word(df$otherinfo_1,2,sep = fixed("'Time':"))
df$race_time_2 = word(df$otherinfo_2,2,sep = fixed("'Time':"))
df$race_time_3 = word(df$otherinfo_3,2,sep = fixed("'Time':"))
df$race_time_4 = word(df$otherinfo_4,2,sep = fixed("'Time':"))
df$race_time_5 = word(df$otherinfo_5,2,sep = fixed("'Time':"))

df$grid_pos_1 = word(df$grid_pos_1,2,sep = fixed(": "))
df$grid_pos_2 = word(df$grid_pos_2,2,sep = fixed(": "))
df$grid_pos_3 = word(df$grid_pos_3,2,sep = fixed(": "))
df$grid_pos_4 = word(df$grid_pos_4,2,sep = fixed(": "))
df$grid_pos_5 = word(df$grid_pos_5,2,sep = fixed(": "))

df$completed_laps_1 = word(df$completed_laps_1,2,sep = fixed(": "))
df$completed_laps_2 = word(df$completed_laps_2,2,sep = fixed(": "))
df$completed_laps_3 = word(df$completed_laps_3,2,sep = fixed(": "))
df$completed_laps_4 = word(df$completed_laps_4,2,sep = fixed(": "))
df$completed_laps_5 = word(df$completed_laps_5,2,sep = fixed(": "))

df$race_status_1 = word(df$race_status_1,2,sep = fixed(": "))
df$race_status_2 = word(df$race_status_2,2,sep = fixed(": "))
df$race_status_3 = word(df$race_status_3,2,sep = fixed(": "))
df$race_status_4 = word(df$race_status_4,2,sep = fixed(": "))
df$race_status_5 = word(df$race_status_5,2,sep = fixed(": "))
```

Dropping the columns created above:

```{r}
drop = c("Driver_Info_1", "Driver_Info_2", "Driver_Info_3", "Driver_Info_4", "Driver_Info_5", "Constructor_Info_1", "Constructor_Info_2", "Constructor_Info_3", "Constructor_Info_4", "Constructor_Info_5", "Driver_Info_1", "Driver_Info_1", "Driver_Info_1", "Driver_Info_1", "Driver_Info_1", "Circuit", "Results", "otherinfo_1", "otherinfo_2", "otherinfo_3", "otherinfo_4", "otherinfo_5", "Results_Position_1", "Results_Position_2", "Results_Position_3", "Results_Position_4", "Results_Position_5", "time")
df = df[,!(names(df) %in% drop)]
```

```{r}
num_cols = c('Driver_Position_1', 'Driver_Position_2', 'Driver_Position_3', 'Driver_Position_4', 'Driver_Position_5',
             'Driver_Points_1', 'Driver_Points_2', 'Driver_Points_3', 'Driver_Points_4', 'Driver_Points_5',
             'grid_pos_1', 'grid_pos_2', 'grid_pos_3', 'grid_pos_4', 'grid_pos_5', 
             'completed_laps_1', 'completed_laps_2', 'completed_laps_3', 'completed_laps_4', 'completed_laps_5')
```

```{r}
fn <- function(x) gsub("'", "", x)
fncol <- colwise(fn, .cols=num_cols)
df[, num_cols] = fncol(df)
```

Converting columns to numeric:

```{r}
df[num_cols] = sapply(df[num_cols], as.numeric)
```

```{r}
colnames(df)
```

```{r}
df2 = df[rep(seq_len(nrow(df)), each = 5), ]
rownames(df2) <- 1:nrow(df2)
head(df2)
```

Exporting the CSV for further cleaning:

```{r}
write_csv(df2, '../../data/01-modified-data/data_cleaning_R.csv', na = '') #to python
```

To be Continued in Python since R does not support handling dictionaries.