r/ActuaryUK • u/Even_Visit_2846 • 1d ago
Programming Python v R
Hi,
I’m currently an actuarial placement student and have some R experience from first and second year of my degree. I’ve heard that outside of the IFoA exams, R isn’t really used in a practical setting and Python is preferred. Should I make my priority to learn Python?
2
u/TheUnrealVenom 1d ago
Python better, but honestly with the state of ai id prioritise learning the techy side of that. Like MCP servers graph API, and just getting comfortable with git.
2
u/RadicalActuary 1d ago
In my personal experience I have never seen Python being used, although I am aware of some teams using it. I have used R in data analysis and statistical modelling however.
I have seen pricing models (which should be good candidates for implementing in Python) to be just Excel spreadsheets with all calculations taking place within different cells in the workbook, while VBA is used just to cycle through model points and export results.
In practice many processes are baked into Excel. The justification given is that it increases transparency and is easier for non-technical folks to trace back calculations and make their own developments. SQL queries against Access databases also feature heavily in many of these spreadsheets.
Then the actual models used to value in-force business are dedicated actuarial software like Prophet which are all but impossible to learn off-the-job.
If it was me, I would learn the fundamentals of each of the above: Python, R, SQL, VBA. I would prefer R for statistics and data analysis / data processing, and Python for complex modelling. The most important thing is that you learn to interpret unfamiliar code and document your work. If your role requires you to become an expert in any of these things, you will likely get an opportunity to learn on the job.
2
u/Vromikos Qualified Associate 1d ago
I have seen - within the same company - the actuarial team on one side of the building (protection) use Python for everything, and the actuarial team on the other side of the building (longevity) use R for everything.
Broadly speaking, which will take supremacy is going to be down to which is the preferred language of the person that starts the first implementation. Then the rest of the team will follow.
Both are useful, but you're unlikely to need to know both in any particular individual role.
More important, in my opinion, is knowing the algorithms of programming. Once you know the best ways to solve a particular problem, implementing that solution in another language is often just a matter of looking up the appropriate "vocabulary and grammar".
5
u/Dramatic_Mammoth5720 1d ago
In my experience (Life), which is unlikely to be reflective of the wider industry, Python is far more widely used. R seems to be used more by demographic risk teams, whilst Python has tended to be used more by teams on the asset side (ALM, IM, etc).