Why you should learn to code
Python is the computer language of choice for accountants. Kirstin Gillon explores its data-handling and statistical capabilities, and Rick Payne describes learning to code
Its popularity is explained by its flexibility and ease of use. Its design philosophy emphasises simplicity, readability and white space, making use of English-like syntax. This makes it easier to learn than other languages, so a lot of beginners try Python as a first step. From a technical perspective, this simplicity also enhances the productivity of programmers.
A further advantage is its open-source licensing, making it freely available to use and distribute, even for commercial purposes. Python also has a strong community and associated eco-system. This has resulted in a lot of libraries of code, particularly around data science and artificial intelligence (AI), which can save time and avoid having to start from scratch every time.
Uses of Python
Python can be used for many things. For example, it is commonly used when building web applications, handling interactions with databases and the flow of data. Python is often used in the development of interactive games, or in data-scraping tools to extract large amounts of data from websites.
From an accountancy perspective, Python is most useful when working with data. It can essentially read any type, both structured and unstructured. It has powerful capabilities in data importation and manipulation – tasks like merging and recoding – as well as handling large amounts.
It also has advanced statistical capabilities that allow for the creation of machine learning models and state-of-the-art graphics.
Python can be used for efficient automation. For example, if you needed to run the same analysis on a new set of sales data each week, doing this in Excel would require opening a different file manually each week and re-entering formulas and other elements needed for the analysis, or creating complex automation with Visual Basics for Applications or Power Query. But you could do that same analysis automatically in a language such as Python, writing a simple script that imports the new data and runs the same analysis each week, outputting the results in whatever format you’d like.
Finally, using a coding language should help to find and fix errors. When you make an error, you’ll typically get an error message that explains what has gone wrong. And of course, you should also have comments explaining each line of your code, which makes it easier to go back and recheck each step looking for mistakes.
Should accountants learn to code?
There can be many benefits from using a language like Python, but is it really necessary for accountants?
Whether or not accountants should learn to code has become a hot topic of debate. For some, especially in the audit firms, Python skills have become increasingly important to support data analytics work. It helps auditors with the data extraction and wrangling work that can be so time-consuming, as well as supporting more statistical analysis. As a result, some firms are putting their staff through Python training programmes.
Others take a different view. Many of the finance functions that we’ve spoken to, for example, have not yet seen a need for their staff to learn these kinds of programming skills. Rather, they expect their staff to be proficient with end-user analytics and visualisation tools, and work with data scientists where more technical expertise is needed.
The practical benefits of learning a language such as Python will vary depending on role. Where accountants are working extensively with large amounts of data, coding is increasingly likely to become part of the job. However, even if many accountants will not be using programming skills in their day-to-day role, there is still value in learning how coding works and developing the logical way of thinking that it entails.
About the author
Kirstin Gillon, Technical Manager, Tech Faculty
ICAEW Data Analytics Certificate
ICAEW has recently launched a Data Analytics Certificate, which includes modules in Python. There are two different learning pathways for the certificate.
Analyst – designed for finance analysts, business partners, auditors and finance managers who want to develop their skills in data analytics, to better support their business and their clients with forward-looking insight (eg, predictive forecasts) and assurance (eg, anomaly detection).
Manager – designed for CFOs, FCs, partners, heads of department and senior managers, who are seeking to enhance the value their analytics teams bring to the business and clients. The course will explain the business benefits of applying data analytics, help build an effective data analytics function and give the skills to interpret and challenge team outputs so that they can be presented back to the business with maximum impact.
The certificates are tailored specifically to the accountancy profession and both pathways include online training, a case study and certification.
For more information, visit icaew.com/dacert
A personal perspective: Using Python – you can teach an old dog new tricks!
Ever since the early days of PCs, I have tried to keep up with new technologies. So, when everyone started talking about data science I wondered how I could get up to speed. Coding seemed important, but I had next to no programming experience. So where to start?
After dabbling with the statistical programming language ‘R’, my reading suggested Python might be a better option, for the reasons outlined in the main article. Hopefully my experiences will be useful to those considering learning to code.
It is amazing what you can do with Python as a newbie programmer. Using YouTube videos and websites I was able to move from the basics through to importing packages and running sophisticated algorithms.
This is very satisfying, even if I did cut and paste some of the code. On top of that there were benefits in learning more about AI and analytics as I went.
However, do prepare to be exasperated when something does not run and it takes hours to spot the syntax error or bug. Do not be fooled by technologists saying Python code is easy to read, that only applies if you are already an experienced programmer. I am not a natural so my progress has not been fast and if, like me, you are not using Python every day you will have to relearn things.
If you do decide to take the plunge there are a few things to think about. Try out a range of online resources – there is a lot of high-quality stuff but also some dross. I do not have a ‘coding buddy’, but I will need some tailored help to make more progress.
Beware of too much cutting and pasting of code – you will not really be learning to code, you will find it difficult to apply Python skills to new problems and, when it comes to analytics, you may misinterpret the results.
I have got a lot out of learning to code with Python. I feel I understand a lot more about data, analytics and AI – both the opportunities and the pitfalls. My ability to communicate with data scientists has also been enhanced.
I think I will continue to work with Python, although I have not found the time to do so over the past few months. I do not believe coding will become an essential skill for all accountants, but if you have an interest I would urge you to at least dip your toe in the water. In the same way some accountants have pushed Excel to its limits, there is no reason why accountants cannot drive a lot of business value through Python.
About the author
Rick Payne, Finance Direction Programme, Business and Management Faculty
Join the Business and Management Faculty
This article is freely available for a limited time.
Business and Management Faculty membership gives you access to exclusive premium content including our regular magazine, webinars, networking events and extensive online resources focused on technical and soft skills to support your career.
For more information about faculty membership, please visit icaew.com/joinbam