Written by Dan Johnson
Is Python the right programming language for insurance?
3 minutes
Dan Johnson, Head of Learning, explores various programming languages and the peculiarities of the insurance industry to highlight why Python is the right programming language for forward-thinking insurers.
In a previous blog discussing the first-ever hx Python for insurance workshop, I highlighted why a programmatical approach to managing insurance modelling is better than building ever more complex spreadsheets. In the same blog, I mentioned that Python is the right programming language to help the insurance industry deliver against the many complexities in model development. But is this true?
This blog dives deeper into the different programming languages and why at hyperexponential, we believe insurers stand to gain the most benefits from leveraging Python in their tech stack.
Let's start by identifying some questions and concerns insurers have when looking to adopt next-generation tools to take their risk modelling to the next level.
There are many programming languages to choose from – what if we choose the wrong one?
Do we have the right skills within our existing team?
Shouldn't we stick with what we know?
There are many programming languages to choose from – what if we choose the wrong one?
A quick Google search tells me there are about 9000 programming languages, with around 2500 currently in use and 250 being popular or common. If we make an uninformed decision at this point, the odds will be stacked nicely against us. No surprise there. So, let's narrow down the search with two key data points. We want a popular language to enable us hire people quickly, and we want one that is well-suited to the type of work we're doing.
Finding popular languages is easy. An organisation called TIOBE checks more than 1 billion lines of software code worldwide, in real-time, every day, to determine the popularity of programming languages. TIOBE also provides an excellent monthly summary of the languages they see in use. Following a strong upward trajectory since 2018, Python is currently #1 since late 2021, and there has been an ongoing tussle with C trying to hold on to the top spot. What about languages that are well-suited to actuarial work? I recently made a poll at an event for actuaries representing 15 independent companies. Here's what I found.
Participants were invited to rank the six options displayed according to how frequently they use each language.
Visual Basic at #1 comes as no surprise, considering the cohort’s considerable expertise with Excel. Python at #2 correlates nicely with TIOBE’s findings, and R, currently at #13 in the TIOBE tables, makes a reasonable showing here due to its strong mathematical modelling history.
Do we have the right skills within our existing team?
Actuaries who are currently modelling risks using, for example, Visual Basic in Excel will find translating those models to a different language a relatively easy task. Many courses are available through platforms like Codeacademy to quickly enable people in other languages.
Additionally, if you look within your team, you will likely be pleasantly surprised. Anyone who graduated with an actuarial-related degree in the last ten years will have had a programming element in their course. Looking at the London School of Economics' Actuarial Science BSc, freshers are picking up Programming for Data Science, which focuses on—you guessed it: Python.
Shouldn't we stick with what we know?
Staying in your comfort zone is always easier but not necessarily the most progressive or rewarding decision. You can probably think of many times you've seen a spreadsheet used as a database, CRM, timesheet, or project tracker. It's the adage, "when the only tool you have is a hammer, everything starts to look like a nail." We're all aware that to keep ahead of the competition, we must use the best tools. Furthermore, to hire and retain the best staff, it is crucial to provide the best options to reduce effort and increase efficiency. Many programming languages can offer this, but we believe Python has the best capabilities for modelling risks in the insurance industry.
In conclusion
At hyperexponential, we believe the Python programming language is best equipped to handle the complexities of insurance modelling most efficiently. This is why we leveraged Python in our next-generation pricing tool, hx Renew, helping actuaries and underwriters build better pricing models faster.
If you'd like to learn more about Python for insurance, register with us for a half-day session here or contact us to see how hx Renew works.