Excel in Python

Young Park
Analytics Vidhya
Published in
4 min readNov 28, 2020

I recently dove head first into the world of data science. Without much prior experience in programming language, learning Python was a challenge in and of itself. In fact, my fear of learning Python is what actually delayed my exploration of data science. Even after starting my data science journey, it took me a while to REALLY buy into Python. After all, why go through all the pain of learning Python when I can just do everything I need to do in Excel?

I come from a traditional finance background where most of my work was done through a complicated web of spreadsheets filled with pivot tables, vlookups, sumifs, conditional statements, and so on. If you come from a similar background as me, you can probably relate to my sentiment and attachment to spreadsheets.

In some sense, it’s a legitimate point. After all, what can’t Excel do? I’ve made my through a number of big companies where the majority of all the heavy lifting related to analysis, reporting, and planning were done through what I call the “Excel eco-system”. Additional features like Hyperion Essbase, SmartView, PowerPivot, PowerBI, and a number of really cool features available on Excel that do make it possible to work with data and get stuff done. In my field, Excel, Alteryx, and Tableau were sort of the go-to “Holy Trinity”.

So the question remains. Why Python?

Here are some reasons that finally convinced me to excel in Python!

  • It’s the number 1 programming language used by experts in the industry. Imagine traveling to a foreign country where they speak a completely different language than you do. How are you going to navigate your way around? How are you going to converse with other people? The same principle applies in the world of data science. If you don’t speak Python, you are going to be lost and get left out of all the great creativity and awesome things that are happening. Not to mention, if you want to work as a data scientist, pretty much all employers require some level of proficiency in Python.
  • You have so much more flexibility in Python than Excel. For instance, imagine running a linear regression model in Python vs Excel. In Python, you can do pretty much everything you need from EDA, Train/Test split, cross validation, feature engineering, scaling, fitting the model, producing predictions, and creating visualizations all in a few lines of Python codes. While possible to accomplish this in Excel, it will definitely require a lot more time and effort to do this.
Example of applying Ridge regularization with Train/Test split, scaling, and visualizations
  • Good news! You can still do “Excel-like” things in Python through Pandas. If you are used to framing data in terms of rows and columns, then Pandas is your new best friend! Filtering rows, converting columns, conditional statements, grouping, and many other features that you can do in Excel, you can also perform the same operations in Python through Pandas!
Example of Pandas Dataframe
  • Have you heard of Scikit-Learn? It’s an amazing machine learning library compatible with Python. You can import and instantiate a bunch of various regression (OLS, Ridge, Lasso, Enet) and classification (logistic, knn, decision tree, random forest, Gradient/Ada boost, SVM) models just with a few lines of codes. In addition, you can also import data preprocessing tools like StandardScaler, PolynomialFeatures and as well as useful modeling tools like train_test_split, cross_val_score, GridSearchCV, and Pipeline.

Learning Python has been such a great experience thus far. While I still have a lot more to learn in terms of developing best practices and being more efficient with my codes, it feels awesome to have Python under my belt as one of the tools that I can leverage to become a better data scientist.

If you are thinking about starting your journey in data science and you are unsure about Python, take it from me, it is an awesome programming language and you’ll be blown away by how much you can actually learn simply by just giving it a try. Whatever hesitation you may have, I hope I was able to give you a small glimpse of hope and motivation to just dive in and give it a try!

--

--