r/learnpython • • Apr 13 '22

What is difficult in excel but easy in Python?

If you were to introduce an established excel user [non VBA] to Python, what would you suggest?

What would amaze them? In as few a lines as possible?

404 Upvotes

241 comments sorted by

View all comments

Show parent comments

5

u/synthphreak Apr 13 '22

nice

I personally think Excel's default graphs look like crap. I think we're just used to them.

You can create a lovely histogram with just a single line using matplotlib: plt.hist(data).

15

u/omgu8mynewt Apr 13 '22

I'm a working scientist and making graphs in python is genuinely terrifying and not-intuitive at all, whereas Excel is very visual and easy to make a simple graph, and change the settings to improve the appearance. I've tried matplotlib a few times and use R, but the learning curve is SO steep for people not from computing backgrounds.

3

u/bonferoni Apr 13 '22

Try plotly.express. Literally a one liner, just a chart type, x, y with bonus options available if you wanna get fancy

2

u/Eurynom0s Apr 14 '22

You're just afraid of matplotlib, which is perfectly reasonable, it IS a terrifying mess. plotly.express is a good suggestion.

2

u/warbird2k Apr 14 '22

There are some cool jupyter lab extentions out there, like Mito and Lux. Mito let's you work with dataframes like they were å spreadsheet and spits out pandas code. I use it to get better at pandas. Lux recommends charts based on your dataframe and intent, and gives you the matplotlib code for it.

0

u/synthphreak Apr 13 '22

I definitely get that. But it also swings both ways.

I used to use Excel all the time - I would almost call myself a power user. But since learning to code, I basically never use Excel, and I've forgotten a lot of how to use it. So if someone asked me to create a chart in Excel, I would really struggle to create and customize it.

In other words, Excel is intuitive only if you're already used to using it. The same is true for matplotlib.

I don't think there's anything that makes Excel plotting objectively easier, other than the fact that the UI is graphical.