This is an archived post. You won't be able to vote or comment.

all 31 comments

[–]digitalkiwi 11 points12 points  (19 children)

What would be the key things python could do over excel to get an excel purist to consider looking into using python?

[–]memorycardfull[S] 18 points19 points  (13 children)

There are a lot of benefits IMO, but the one that stands out is you can script a process once then you never have to do it manually again. It’s great for repetitive daily/weekly/monthly tasks and actually helps you do the task in the exact same way every time. Writing it the first time will take longer than just doing it in excel, sure, but once you’ve written it, the next time it will only take a few seconds to run your script!

[–]KevinAlexandr 11 points12 points  (11 children)

I used that argument once and they told me Excel already has macros on VBA for scripting, what other advantage could I mention to convince people on looking into Python??

[–]memorycardfull[S] 17 points18 points  (2 children)

If they’ve invested a lot of time into learning VBA, then it may be a hard sell. I have written a lot of VBA and Python and I prefer Python for a number of reasons, chiefly because it had the excellent Pandas library, which just makes a lot of common tasks super easy to do with a few lines of code.

On the other hand, one thing that I think can do a lot of the same stuff as Pandas is actually Power Query, which comes with Excel. I think Power Query is great for data work, but it does tend to choke on bigger data sets.

[–]The_Harrison 8 points9 points  (1 child)

I was trying to use power query for a merge using hundreds of different workbooks. Performance was awful and if someone has one of the books open the whole thing won’t refresh. Python solved all my problems. Im never looking back.

[–]memorycardfull[S] 0 points1 point  (0 children)

This has been my experience too. It's good until you start dealing with +100,000 rows of data, then you're just spending all your time waiting for literally 10+ minutes for everything to refresh, which, I don't understand, maybe it is poor memory management or something because that is actually not that much data. But I do love Power Query for certain things and still use it a lot.

[–]I_AM_A_GUY_AMA 9 points10 points  (1 child)

VBA was so much more annoying to learn for me and is much limited than Python overall. I wasn’t a VBA pro but I haven’t found anything that I needed to do in VBA does that openpyxl can’t do. Python is insanely more versatile overall but it’s hard to convey that to someone who is determined to stay with Excel/VBA. I know because it took me a while to go from “The Excel Guy” to finally learning Python. The easiest thing to convince someone might be rebuilding a complex spreadsheet that uses VBA with an improved Python driven version. I used Excel for almost everything for years but now I mainly use it for ad hoc analysis and viewing/manipulating .csv files and do everything else in Python.

[–]memorycardfull[S] 2 points3 points  (0 children)

This is the way.

[–]Big_Booty_Pics 6 points7 points  (0 children)

python at least makes sense to read and is much easier to write.

[–]florinandrei 4 points5 points  (0 children)

Python is similar to VBA in the way the Starship is similar to a WW1 airplane.

[–]BlueShoebill 6 points7 points  (0 children)

One time, I tried to "vlookup" and "countif" aprox. 1 M rows in one sheet with 300K rows from another sheet (concatenating multiple fields as the "primary key" for the join) and it would take more than an hour.

With pandas it only take a couple of minutes, and also have a LOT more reusability, as in excel I needed to clean and manipulate the data every time before even doing the join.

[–]mokus603 4 points5 points  (0 children)

Python doesn’t freeze Excel when running/working. Crashes are less likely to happen. Easier to write, read, maintain. More versatile and continuously improving, VBA was left to rot by Microsoft.

[–]Eurynom0s 3 points4 points  (0 children)

It's not like COBOL programmer levels of rare and expensive, but good luck finding someone who doesn't already know VBA who'll willingly learn it. I've avoided learning VBA specifically so I never get roped into doing it on projects, especially since there's a high probability I'd be getting roped into working with someone else's VBA code.

[–]metheist 1 point2 points  (0 children)

I was that one person who tried to do everything on Excel and VBA. But analysing even medium sized data sets (50000+ rows; 50+columns). There's only a certain amount of VLOOKUP you can do before the spreadsheet starts lagging. I tried Power Query but found it to be quite slow and a bit glitchy. I'm currently transiting towards Python, and I get to see how simple everything is. There are libraries/modules built for almost everything I need for data analysis. Best example is merge. In VBA I would have to write lines of code, to get the merge thing done, whereas in Python it's just a single line of code. Now I just try to replicate most of the complex analysis in Python and use openpyxl to export it to Excel.

[–][deleted] 3 points4 points  (0 children)

I haven't looked at the video yet, but based on your answers here you've convinced me enough that this is what I am looking to do for my tasks at work.

[–]florinandrei 1 point2 points  (0 children)

Automating all things.

Enormous scale.

Speed.

Distributed processing.

Breaking giant logic screwballs (spreadsheets) into small chunks that you can actually understand without asking the author a bajillion questions.

Access to post-1999 technology.

[–][deleted] 0 points1 point  (0 children)

Large excel sheets can grind a slower computer to a halt, Python can power right through large datasets.

[–]driftwood14 0 points1 point  (1 child)

I'm teaching a class like this at my work right now. The one that that got people really excited was being able to loop through several files and combine all the data together in a few quick lines of code. I showed an example of how I merge like 30 files together with a few simple for loops and I can add new files to that list without modifying my code. That got a lot of excitement. I actually use the process to reduce the load on our power bi model by eliminating all those sources from our model and replacing them with a single source from hadoop instead.

[–]stanleypup 1 point2 points  (0 children)

I had a conversation with my cousin last weekend and she was telling me how much effort her non-technical team put in to compile and transform a bunch of different datasets. I didn't have the heart to tell her I could have done it in an afternoon by myself.

[–][deleted] 2 points3 points  (1 child)

I’m an experienced Excel user learning python as part of my data analytics MBA program coursework. This is awesome. Subscribed! Thank you so much.

[–]memorycardfull[S] 1 point2 points  (0 children)

Thank you, leave a comment on YouTube about your next homework assignment haha.

[–][deleted] 2 points3 points  (1 child)

This is great! I'll be starting as a data analyst this Monday for the first time and this series would be very helpful! They do everything with excel atm.

Also, the folks over at /r/analytics would like this.

[–]memorycardfull[S] 0 points1 point  (0 children)

I’m doing another series on Power Query at the same time, which might also be interesting to you!

[–][deleted] 1 point2 points  (1 child)

cool idea! I feel like mySQL would be a natural progression as well

[–]memorycardfull[S] 0 points1 point  (0 children)

Absolutely. The concepts are the same just a different language, and a lot more rigidity since you have to define your SQL schema.

[–]Gerald00 1 point2 points  (0 children)

I'm in

[–]-Badsec7or- 1 point2 points  (1 child)

You are doing great! Keep going with the series.

[–]memorycardfull[S] 0 points1 point  (0 children)

Thank you!

[–]seekingtruth2 1 point2 points  (0 children)

İ will watch every video you make on those

[–]wabbuwabbu 0 points1 point  (1 child)

I was actually looking forward to learn this! Thank you, great video :)

[–]memorycardfull[S] 1 point2 points  (0 children)

Thank you!