ICAEW.com works better with JavaScript enabled.

Why use Python when we already have Excel?

Excel is an invaluable tool, but it has its limitations. Here are 9 examples of when Python is a more effective and efficient choice.

1. More powerful data importing and manipulation

Unlike Excel, Python can essentially read any type of data, both structured and unstructured data. Data manipulation – tasks like sub setting, merging, and recoding data – is also much easier in Python. Anyone who’s spent a lot of time trying to merge and clean several large datasets in Excel for analysis can attest that it’s a difficult and time-consuming process. But Python make this process both simpler and faster.

2. Easier automation

Excel can be a big hindrance when you’re trying to automate a process or run the same analysis multiple times. Using Python can make this much faster. 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. But you could do that same analysis automatically in a language like 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.

3. Easier working with lots of data

In Excel, projects are organised in sheets or tabs, and if you’ve ever dealt with Excel files that have tons of sheets or lots of data entries in each sheet, you know that it can get very slow very quickly. Python, however, can handle large amounts of data much more quickly.

4. More reproducible

Data analysis is most useful when you can explain what you’ve done to others, and others can easily reproduce your work to confirm it (or you can reproduce it yourself to double-check). But this is difficult in Excel. In Python re-running an analysis is as simple as pressing “Enter”, and it’s easy to add comments to your code.

5. Easier to find and fix errors

When you’ve made an error in Excel, figuring out what’s gone wrong can be difficult. But when you make an error in a coding language, 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 re-check each step looking for mistakes.

6. Open source accessibility

Excel is great, but it’s owned by Microsoft, which means you’re ultimately you are reliant on Microsoft in terms of updates and feature support. Unlike Excel, Python is free and open source, this also means that any developer (including you) can create packages and add functionality to improve ease-of-use.

7. Advanced statistics and machine learning capabilities

Python has more advanced statistical capabilities than Excel and allow for the creation of machine learning models.

8. Advanced data visualisation capabilities

Obviously, Excel can create a variety of charts, but programming languages can do more, Python has better, more advanced and state-of-the-art graphics capabilities. The easier you can make understanding your data, the more likely it is that your work will have a real impact.

9. Cross-platform stability

Scripts in programming languages like Python can be run on any platform and will work across Windows, Mac, and Linux machines, but the same isn’t always true of Excel files.