My thoughts on Python in Excel
xlwings.org
My thoughts on Python in Excel
1–10 of 123 posts
Re: My thoughts on Python in Excel
#2I have used excel in the past, and I am a long term python user. But if you asked me today what I really wanted to make my life easier and ultimately a product or business better using only excel? I would ask for lua or scheme. I don’t need a batteries included environment embedded into a spreadsheet. I just want sane syntax for common functionality which does not require arcane knowledge and long forgotten wisdom.
Re: My thoughts on Python in Excel
#3Without interacting with it myself, none of this is surprising. I have used excel in the past, and I am a long term python user. But if you asked me today what I really wanted to make my life easier and ultimately a product or business better using only excel? I would ask for lua or scheme. I don’t need a batteries included environment embedded into a spreadsheet. I just want sane syntax for common functionality whic…
I don't get your "shouldn't need batteries-included environment" objection; MSFT is bundling Anaconda distribution libraries with Excel. I'd expect it works seamlessly online and offline, as far as everything supported by Python stdlibs. (Can you actually point to any real problem with the batteries?) Really the only part I see you can quibble is things that are currently only implemented in uncommon third-party libraries, i.e. not stdlibs/numpy/scipy/scikit-learn/pandas/polars and the main plotting, data-science, ML, DB and web libraries.
> I just want sane syntax for common functionality which does not require arcane knowledge and long forgotten wisdom.
Show us some Python syntax for common functionality in Excel which does require arcane knowledge and long forgotten wisdom. Otherwise, this is purely your conjecture.
(If anything, bundling Python with Excel will stimulate healthy discussion towards which Python stdlibs need to be added/enhanced/changed, and which third-party libraries should be upgraded to stdlibs.)
Re: My thoughts on Python in Excel
#4Excel's changes will end up eating their reason to exist.
Re: My thoughts on Python in Excel
#5> Integrating the Jupyter notebook cells inside the Excel grid was a mistake. 100% agreed. this seems like the typical Microsoft behavior where the team A was pushing their product and won over team B, even though it's not really what users needed
> Python in Excel isn’t suitable for Python beginners nor for interactive data analysis. exactly. it is my humble opinion that Microsoft doesn't really understand how Excel is used IRL
also this bit is gold:
> What I find interesting though is the multiline editing experience of PY cells. Why not give the native Excel formula language an upgrade, so I don’t have to write LET expressions such as the following one (that I still find very hard to read):
=LET(x, 1, y, 2, x + y)
> Instead, allow me to write it like so? let x = 1
let y = 2
x + y
and we haven't even talked about =LAMBDA()!> Also, why not turn Excel tables into a native Excel DataFrame? Give them attributes instead of sticking to the functional approach and you’d be looking at something like this:
> =MyTable[#All].GROUPBY(...)
> Lot’s of possibilities to integrate the pandas functionality in a way that feels more native to Excel!
Jackpot. I'm literally building this formula language in a new spreadsheet app (it's early days but I'm eager to share it on HN when the MVP is ready!) and am writing a paper on dataframes vs. spreadsheets, so reading this has warmed my heart on this rainy afternoon
also as a former Django lover (I still love it, i just don't use it as much), `=MyTable[#All].GROUPBY(...)` reminds me of its ORM...
"hmm emoji" indeed.....
Re: My thoughts on Python in Excel
#6Without interacting with it myself, none of this is surprising. I have used excel in the past, and I am a long term python user. But if you asked me today what I really wanted to make my life easier and ultimately a product or business better using only excel? I would ask for lua or scheme. I don’t need a batteries included environment embedded into a spreadsheet. I just want sane syntax for common functionality whic…
Re: My thoughts on Python in Excel
#7Oh, no. This is MS Excel 4.0 Macro sheets (Ctrl+F11) all over again, except somehow with a worse execution order.
> It prevents you from referencing a cell with a Python object directly, as you’re always running the risk that someday, someone switches that cell to Values mode, which would break any formula that references this cell in object mode.
That's not a major concern. Excel already has a dozen footguns painted exactly this colour.
> So which output is my df1, and which one is my df2? I have no idea unless I look up the code that is sitting in cells L2 and K2
Excel still lets you name cells, does it not?
> In fact, I agree that the cloud is the best way to bring Python to Excel.
Heretic!
Re: My thoughts on Python in Excel
#8> PY cells are evaluated from left to right and top to bottom. This includes the sheets, so the first sheet gets calculated before the second sheet, etc. Oh, no. This is MS Excel 4.0 Macro sheets (Ctrl+F11) all over again, except somehow with a worse execution order. > It prevents you from referencing a cell with a Python object directly, as you’re always running the risk that someday, someone switches that cell to V…
It does, but that too is a half assed feature so users struggle with it IRL
Re: My thoughts on Python in Excel
#9One should note that this comes from xlwings, a Python-in-Excel plugin with a $1,490 professional lifetime license. Excel's changes will end up eating their reason to exist.
Re: My thoughts on Python in Excel
#10I suggest you do what my brother does and unanswer the question! He works for quite a large firm and is surrounded by quite a lot of data. He is a Windows user by routine and asked me for some help. I got Python + MS Visual Code installed and integrated for him and off he went.
He is an expert with the data and its "knowledge" and was willing to roll up his sleeves and get to grips with a grubby data processing facility. He decided on Python and he is my "customer" so I did the best I could too hence anaconda and VS code.
He grabs data out of SAP (he's senior enough to get IT to do his bidding) and then passes that through Python scripts and then passes that on to Excel for reporting.
What many seem to forget is that most apps are chainable. It's often referred to as the "unix philosophy" - each component should do one job and do it well. That's nice but also bollocks when abused as I have just done.
If Python is not integrated properly within Excel then do it yourself via whatever interfaces are available. Pass in and out with .csv or whatever. You just need some imagination.
For me: I use Libre Office and despite owning my company, I don't require everyone else to do so. I believe in freedom and expression of choice.