Friday, July 14, 2017

Python and R Wrappers for the ergast F1 Results Data API

A week or so ago, Will Vaughan tipped me off to a Python package he's started putting together to wrap the ergast motor racing results database: ergast-python.

He's also making a start on some Wrangling F1 Data Jupyter notebooks that make use of the wrapper: wranglingf1data.

Very nice:-)

It also prompted me to finally split out my own crappy ergast API wrapper R code into an R package of its own: ergastR.

It needs tidying up, and could probably do with being updated to "new R" and a more recent JSON package, but it should work enough to cope with my own Wrangling F1 Data With R code. (If it doesn't, shout!)

The R package also needs work on the following: cacheing, so that we don't keep hitting the ergast API unnecessarily; paged results handling (I fudge this a bit at the moment by explicitly setting a large results limit); and dual handling of ergast API versus ergast database requests. (If a database connection string is passed, use that rather than make a call to the ergast API.)

Any issues with the R package, please feel free to raise them on the Github site, although I can't guarantee how quickly I'll get to them...

Monday, July 10, 2017

Sunday, July 9, 2017

F1 Austria Qualifying Report

Qualifying summary:

Qualifying summary - relative laptimes:

Session utilisation:


Q1 cutoff time evolution:

Q1 equivalent grid:



Q2 cut-off time evolution:

Q2 equivalent grid:


Q3 front-row cut-off time evolution:


Q3 equivalent grid:

Monday, June 26, 2017

F1 2017 Azerbaijan - Looking for Stories...

It's one thing to watch the race, it's another to look at the charts to try to spot things that may be of immediate interest. So from a quick skim of the charts, which ones jumped out at me?

For a null point starter for 10, the track position chart. From lap 35 or so, we see the race evolve at the front, if nothing else...



In terms of battlemap charts, Bottas has one of the more interesting ones... Can you just feel yourself holding your breath from lap 39 or so...?

Hamilton was casually hassled for the first half of the race (not that interesting, though?) and hassling from lap 30 or so:


So how do Vettel see it? Close fought throughout?


Stroll was battling from the off (but there's a lot of boring safety car stuff in there in the first half of the race?), makes space on MAG behind, and then BOT starts to threaten... Gulp... How much per lap..?


 Looking at the charts, you'd maybe credit VAN with a charge?



So.. the race from Bottas' perspective looks like it may have stories to tell... How does it look from the track concordance perspective?


Fun...?!:-)

And what about Ricciardo? How did he go about getting from 19th to the top step of the podium?



Passes on MAG, HUL and STR maybe...? But then he was gifted?


Thinks... it would be really nice to link those two charts together interactively, so that highlighting an element on one chart highlighted the other instances of that driver on the same chart and the other chart?

Sunday, June 25, 2017

F1 2017 Azerbaijan Qualifying

How the session progressed:


How they qualified:
In terms of time:
Going from Q1 to Q2:
  • KVY failed to improve his time, recording 103.186 compared to 102.927 (0.259s slower)
  • HUL failed to improve his time, recording 104.267 compared to 103.93 (0.337s slower)
  • WEH failed to improve his time, recording 104.603 compared to 104.317 (0.286s slower)
Going from Q2 to Q3:
  • STR failed to improve his time, recording 102.753 compared to 102.284 (0.469s slower)
  • MAS failed to improve his time, recording 102.798 compared to 102.735 (0.063s slower)
  • RIC failed to improve his time, recording 103.414 compared to 102.215 (1.199s slower)

How Q1 cut-off time progressed:

As-if time-based grid from Q1 times:

 How Q2 cut-off time progressed:
As-if time-based grid from Q2 times:
 How Q3 front-row cut-off time progressed:
As-if time-based grid from Q3 times:








Saturday, May 27, 2017

F1 2017 Monaco Qualifying

Qualifying position, slopegraph summary

Session utilisation - when were cars on track during the session?

Cut-off time evolution - Q1:


Session best time, Q1 - grid relative to timing:


Cut-off time evolution - Q2:


Session best time, Q2 - grid relative to timing:


Front-row of grid cut-off time evolution - Q3:


Session best time, Q3 - grid relative to timing: