Learn Python with Talk Python's 270 hours of courses

Python in F1 racing

Episode #296, published Wed, Dec 23, 2020, recorded Mon, Nov 16, 2020

Quick: Name the 3 most advanced engineering organizations you can think of? Maybe an aerospace company such as SpaceX or Boeing come to mind. Maybe you thought of CERN and the LHC. But in terms of bespoke engineering capabilities, you should certainly put the F1 racing teams on your list.

These organizations appear as 20-30 people on a race day shown on TV. But in fact, the number of people back at the home base doing the engineering work can be over 500 employees. Almost every tiny part you see on these cars as well as the tools to maintain them are custom-built.

The engineering problems solved are immense. Would it surprise you to know that Python is playing a major role here? On this episode, you'll meet Joe Borg who help pioneer Python's adoption at several F1 teams.

Episode Deep Dive

Guests introduction and background

Joe Borg is a seasoned software developer who spent years building Python-based systems at multiple Formula One (F1) racing teams. During his time at Force India (later Racing Point) and Scuderia Toro Rosso (now AlphaTauri), Joe pioneered the replacement of large, fragile Bash scripts and Excel/Matlab pipelines with more robust, scalable Python workflows. After leaving F1, he joined Canonical to work on Kubernetes deployments, further deepening his expertise in Python for high-performance computing. Joe shares detailed insights into how Python drives cutting-edge engineering at F1 teams and the steps he took to modernize those workflows.

What to Know If You're New to Python

Many parts of this episode discuss using Python to replace older tooling (Bash scripts, Excel macros, and MATLAB). You’ll get more out of this conversation if you have a basic understanding of Python’s syntax, libraries like NumPy, and common web frameworks such as Django. Here are a few resources to get you started:

  • Python for Absolute Beginners: A step-by-step introduction to Python’s fundamentals so you’ll be ready to follow the advanced use-cases Joe describes.

Key points and takeaways

  1. Python’s central role in F1 engineering workflows F1 teams are vast engineering organizations, often employing hundreds of people dedicated to aerodynamics and vehicle design. Python serves as the “glue” that connects tasks ranging from CAD data processing to CFD simulation and wind tunnel test analysis. By combining readability, a huge library ecosystem, and easy integration with existing tools, Python has become a go-to language in F1.
    • Links and tools:
      • NumPy for numerical operations
      • Matplotlib for plotting simulation results
      • Django for custom web dashboards
  2. Replacing Bash scripts and Excel with robust Python Many early F1 data pipelines started as massive Bash scripts and Excel macros. Joe helped convert these unwieldy systems to Python, enabling features such as modular code, comprehensive version control, and more dynamic reporting. This transformation cut maintenance overhead and allowed quicker iteration on engineering problems.
  3. Transition from MATLAB to Python Vehicle science and aerodynamics often rely on MATLAB for simulations, but licensing constraints and limited automation capabilities became bottlenecks. Joe introduced NumPy and related libraries to replicate much of MATLAB’s functionality at a fraction of the cost. This approach also made it easier to schedule and integrate computations into larger, automated pipelines.
  4. Air-gapped, high-performance computing clusters Due to strict FIA regulations (including limits on floating-point operations for CFD), F1 teams often host large on-site clusters rather than using public clouds. This environment demanded specialized Python-driven workflows for job scheduling, data processing, and reliable throughput without risking performance overhead on regulated compute nodes.
  5. Using Django for real-time dashboards Joe rebuilt a static PHP-based site into an interactive Django web app, giving engineers dynamic dashboards to visualize terabytes of aerodynamic data. By returning JSON endpoints and letting JavaScript frameworks handle front-end updates, these dashboards could continuously refresh with new CFD and wind tunnel data in near real-time.
  6. Integrating C for performance-critical sections Although Python handles the majority of tasks, certain operations were performance-critical. By writing small C/C++ extensions (often via CPython’s API), Joe achieved the necessary speedups for time-sensitive computations used repeatedly in the F1 data pipelines. This mixed-language approach combined Python’s ease of use with native-level speed.
  7. Collaborative development and version control Deploying new Python-based features meant letting aerodynamicists and vehicle dynamics engineers tweak code without fear of breaking everything. Robust version control (Git) and a standardized approach (Python modules, unit tests) fostered a healthy dev culture. F1’s demanding environment incentivized quickly merging essential fixes while still maintaining code quality.
    • Links and tools:
  8. Testing and reliability under intense deadlines While F1 is famously fast-paced, Joe emphasizes the importance of test-driven approaches where possible—though integration testing was sometimes elusive. He notes a shift to more rigorous testing in certain areas, particularly as automation and cluster-driven computations grew more complex.
  9. Stepping out of F1 into Kubernetes Joe now works at Canonical, focusing on distributing and managing Kubernetes clusters with Python-based solutions. Although different from F1, the key theme—replacing fragile processes with well-tested Python code—remains the same. Charmed Kubernetes and MicroK8s provide examples of how to streamline cluster setup and scaling using modern Python tools.
  10. Personal journey from racing to open source Joe credits his time in F1 for pushing him to learn “clean, fast, and flexible” software design. He shares how living next to the aerodynamicists encouraged daily collaboration, culminating in deeper adoption of Python. While the racing world is high-stress, Joe’s story shows how forging new paths with open-source tools can be both exhilarating and rewarding.

Interesting quotes and stories

On transitioning from Bash to Python: “You change a line in Bash and you’ve got no real accountability for that change. Python is just so much more robust and safer.”

On F1’s HPC limits: “We were literally measured on how many floating point operations per cycle we used, so we couldn’t just throw more CPU at the problem.”

Reflections on teamwork: “Working in Formula One was a great lesson in how developers and engineers can sit together and deliver quick fixes that make a real performance difference.”

Key definitions and terms

  • CFD (Computational Fluid Dynamics): Simulating fluid flow around the race car to optimize aerodynamic performance.
  • Wind Tunnel: A specialized testing setup where scale models of cars are exposed to controlled airflow to measure aerodynamic forces.
  • CPython: The official reference implementation of Python, which allows you to write C-extensions for performance.
  • Charmed Kubernetes: A flexible Kubernetes distribution from Canonical that uses Python “charms” to define and manage individual services in a cluster.

Learning resources

  • Python for Absolute Beginners: Great if you need a firm foundation in Python before diving into specialized engineering use-cases.
  • Move from Excel to Python with Pandas: Perfect for anyone looking to replicate or enhance spreadsheet-based data workflows, exactly like Joe did in F1 for aerodynamic and vehicle data.
  • Django: Getting Started: If you’re inspired by Joe’s replacement of a PHP site with an interactive Django web app, this course will set you on the right path.

Overall takeaway

Joe Borg’s journey illustrates how Python has become an indispensable tool in Formula One racing, transforming everything from computational fluid dynamics to on-demand dashboards for engineering teams. His work highlights the adaptability of Python for large-scale numeric processing, real-time data visualization, and web development under intense and highly regulated conditions. Ultimately, his story reminds us that combining straightforward, collaborative code with modern hardware and open-source approaches can drive innovation well beyond motorsport—and into any performance-critical domain.

Links from the show

Joe's website: josephb.org
Joe on Twitter: @joedborg

Racing Point F1 team: racingpointf1.com
Scuderia Alpha Tauri F1 team: scuderiaalphatauri.com

MicroK8s: microk8s.io
Charmed Kubernetes: ubuntu.com/kubernetes
Episode transcripts: talkpython.fm

--- Stay in touch with us ---
Subscribe to Talk Python on YouTube: youtube.com
Talk Python on Bluesky: @talkpython.fm at bsky.app
Talk Python on Mastodon: talkpython
Michael on Bluesky: @mkennedy.codes at bsky.app
Michael on Mastodon: mkennedy

Talk Python's Mastodon Michael Kennedy's Mastodon