Skip to content

0.0. Why use Python

Python is one of the most popular programming languages in the world - especially in data analytics.

It is a high-level, general-purpose language known for its ease of use, readability, and huge ecosystem of libraries.

In such a highly competitive, regulated, complex industry, bad analysis carries risk, and so using the right tools in the right way to ensure the highest quality analysis is imperative.


How can Python help our pricing workflows?

For nearly a decade, Python has been a staple in analytics teams across many industries. This has led to the development of a vast number of tools and libraries designed specifically for analytical purposes.

In insurance pricing, however, Excel and closed-source software remain dominant. This often means analysis and processes are built on an ad-hoc basis, relying on many manual steps.

Python changes this by allowing you to:

  • Build reproducible analytics - ensuring results can be easily re-run and verified.
  • Innovate - exploring the latest advancements in data science and analytics, which is rarely possible if your team relies solely on Excel or proprietary software.
  • Collaborate efficiently - multiple analysts can safely contribute to the same project without overwriting each other’s work.
  • Scale processes - from a quick one-off analysis to a daily automated workflow, all the way to systems serving millions of quotes per month.
  • Integrate with other tools - APIs, databases, dashboards, rating engines, and reporting platforms.
  • Maintain transparency - every step is visible in the code, aiding audit trails, peer review, and regulatory compliance.

Isn't Excel the perfect tool for analysis?

While Excel is extremely common and familiar, it often leads to the following scenarios:

  • Teams spending more time cleaning and processing data than analysing it.
  • Processes involving extensive manual work and copy-pasting.
  • Errors that go unnoticed amongst complicated steps
  • Projects that take months to complete but cannot be reproduced or reused.
  • Work that cannot be refreshed with new data or additional factors.
  • Spreadsheets so complex only the original creator can run them.
  • Debugging that requires tracing across cells and sheets, picking apart hard-to-read formulae.
  • Reporting being run manually rather than automatically.

By contrast, Python - combined with good engineering practices - allows you to:

  • Build reusable components that can be shared across different pricing processes.
  • Improve auditability and quality through setting out analysis as a distinct set of steps.
  • Productionise processes so they run automatically, freeing analysts to focus on deeper insights and infrastructure improvements.
  • Apply proven software engineering concepts like automated testing, continuous deployment, and abstraction to reduce errors.

What about paid software?

There’s always a trade-off between building or buying solutions. In insurance pricing, we are fortunate to have that choice.

The pros and cons of software are beyond the scope of this course, but many teams spend hundreds of thousands, even millions annually on software when a more flexible, easier to maintain, higher-quality solution could be built using free, open-source tools.


Side effects of learning to code

Programming is more than just learning syntax. It teaches:

  • Good system design.
  • Thinking ahead about maintenance.
  • Writing code that others can understand and adapt.

These skills apply beyond Python - they make you a better pricing analyst in Excel or closed-source tools too.


Why Python instead of R?

For many analytical tasks, if one language can do it, so can the other.

However, Python’s popularity means a wider selection of libraries and faster adoption of new methods.

When building systems that integrate with other tools, Python is almost always better supported.

For example SendGrid (popular email automation service) and Azure Functions (a common choice for running code in the cloud) both support Python but not R.

When building systems with multiple components and processes, Python’s ecosystem makes it the more versatile choice for integrating analytics into production systems.