Excel vs Python: How to do Common Data Analysis Tasks

A comparative approach using Excel and Python


Excel is the most commonly used data analysis software in the world. Why? It’s easy to get the hang of and powerful once you learn it. In contrast, Python’s reputation is that it’s more difficult to use, though what you can do with it is once you’ve mastered it is almost unlimited.


But how do these two tools actually compare? Their reputations don’t really reflect reality. In this article, we’ll take a look at some common data analysis tasks to demonstrate how accessible Python analysis can be.


Why use Python vs Excel?

Before we start, you might be wondering why Python is even worth considering. Why couldn’t you just keep using Excel?


Even though Excel is great, there are some areas that make a programming language like Python better for certain types of data analysis. Here are some reasons :

  1. You can work with almost any kind of data.

  2. Automated and repetitive tasks are easier.

  3. Working with large data sets is much faster and easier.

  4. It’s easier for others to reproduce and audit your work.

  5. Finding and fixing errors is easier.

  6. Advanced statistics, machine learning, and data visualization capabilities.

  7. Cross-platform stability — your analysis can be run on any computer.

To be clear, we don’t advocate leaving Excel behind — it’s a powerful tool with many uses! But as an Excel user, being able to also leverage the power of Python can save you hours of time and open up career advancement opportunities.


It’s worth remembering the two tools can work well in tandem, and you may find that some tasks are best left in Excel, while others would benefit from the power, flexibility, and transparency that’s offered by Python.


Importing Our Data

Let’s start by familiarizing ourselves with the data we’ll be working with. We’ll use fictional data about a company with salespeople. Here’s what our data looks like in Excel:


Sales.csv — By Author