Live data from Hacker News

My thoughts on Python in Excel

xlwings.org

101–110 of 123 posts

Re: My thoughts on Python in Excel

#101

As a counterpoint to a lot of the speculation on this thread, if you're interested in learning more about how and why we designed Python in Excel, I wrote up a doc (that is quite old but captures the core design quite well) here [1]. Disclosure: I was a founding member of the design team for the feature. [1] https://notes.iunknown.com/python-in-excel/Book+of+Python+in...

I'm genuinely curious why python instead of something like PowerShell for Excel specifically. Seems a little out of the farm but I also get how it's a more adopted language.

Python is the most popular language for data analysis with a rich ecosystem of existing libraries for that task.

Incidentally I've worked on many products in the past, and I've never seen anything that approaches the level of product-market-fit that this feature has.

Also, this is the work of many people at the company. To them go the real credit of shipping and getting it out the door to customers.

Re: My thoughts on Python in Excel

#102
post #11

The big problem is that this is exactly backwards. I rarely want to access Python from my Excel. I quite often want to access Excel from my Python. A spreadsheet is a great GUI for a lot of things. A lot of people are employed creating "shitty version of Excel but can be driven from any of " Being able to easily drive Excel from an external Python program would make for a nice cross-platform application substrate.

I've used Python libraries to generate reports in Excel, frequently enough that at my last job I wrote a custom library to wrap xlsxwriter to simplify for my use case. Tremendously useful.

Would you mind explaining in more detail what your custom library enabled?

Re: My thoughts on Python in Excel

#103

As a counterpoint to a lot of the speculation on this thread, if you're interested in learning more about how and why we designed Python in Excel, I wrote up a doc (that is quite old but captures the core design quite well) here [1]. Disclosure: I was a founding member of the design team for the feature. [1] https://notes.iunknown.com/python-in-excel/Book+of+Python+in...

I'm genuinely curious why python instead of something like PowerShell for Excel specifically. Seems a little out of the farm but I also get how it's a more adopted language.

To associate Excel with all those third-party Python analytical packages. Monte Carlo comes to mind; in the distant past, that was an expensive third-party Excel plug-in.

Re: My thoughts on Python in Excel

#105
post #22
post #4

One 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.

If you take a look at Excel’s implementation, Python in Excel is going to be part of this person’s sales funnel.

I'd expect this once users see what can and cannot be version-controlled.

Re: My thoughts on Python in Excel

#106
post #21

The cloud thing bugs me because a lot of times buying things, managing licenses, etc, is a hassle. I disagree that bundling Python wouldn't work given blender does it, I think inkscape does it, and done other common programs. Would it be nice if they didn't? Sure. But they do and I trade a fraction of a percent of my disk space for that modularity. Also, there are a few excel handling packages for Python. I've even m…

ArcGIS, SPSS; a lot of unwieldy packages with legacy format considerations allow you to specify a virtualenv.

Re: My thoughts on Python in Excel

#107
This feels like a variation on Zawinski's Law: Every program attempts to expand until it can run python [read mail]. Those programs which cannot so expand are replaced by ones which can.

Or more broadly, the inner-platform effect. I'm left wondering "why would you use python within the lousy coding interface of excel, when Pandas already exists?"

Re: My thoughts on Python in Excel

#108
post #81
post #42

Earlier quoted context omitted.

That workflow sounds so painful. Why not get a BI tool that can integrate directly into your data warehouse and do reporting through that?

It's really not, I've used python in the past but prefer R for this. As it stands excel is a better presentation layer than almost all BI tools once you're past the modelling and analysis stages.

With this, you get:

- Reproducibility (the official, bundled Excel numerical routines have/had errors greater than floating-point precision) which avoids the unprofessional look of, say, least squares numbers that differ from a check by hand.

- Version and environment control. This is the fastest way I can answer the question, "what would these new routines produce if run against last October's pool of databases?"

- A presentation format where client customizations for style, dimensional units and currencies, human language, etc. can all be owned outside of your project.

I try to sell this approach when I can. Is there a particular BI that strikes a better balance?

Re: My thoughts on Python in Excel

#109

This feels like a variation on Zawinski's Law: Every program attempts to expand until it can run python [read mail]. Those programs which cannot so expand are replaced by ones which can. Or more broadly, the inner-platform effect. I'm left wondering "why would you use python within the lousy coding interface of excel, when Pandas already exists?"

Once Python became the lingua franca for next-gen HPC applications (i.e. machine learning), we had a good indication that the (higher-level) programming language wars will soon be over.

Students graduating today are comfortable in Jupyter notebooks but not a CLI.

Also on HN front-page is a full implementation of llm.c in Python-superset Mojo.

Once Python takes off in the browser, either by compiling to WASM (via something like Mojo) or interpreted by PyScript, it's over.

Total GvR victory.

Re: My thoughts on Python in Excel

#110

Earlier quoted context omitted.

I've used Python libraries to generate reports in Excel, frequently enough that at my last job I wrote a custom library to wrap xlsxwriter to simplify for my use case. Tremendously useful.

Would you mind explaining in more detail what your custom library enabled?

It's been long enough that my memories are fuzzy.

I do remember defining a specific format for a cover page: merging a large block of cells and customizing the font information within. I suspect I had other formatting convenience functions to make the reports more consistent.

I created a single data structure to wrap the workbook and worksheet objects and include a "current" row/cell tracker, so that I could invoke an "add row" function to write the next row in the sheet without indicating where in the worksheet the data should be added.

Each write function would then take as arguments the data structure and a string label to indicate which worksheet I wanted (numeric indexing was also an option, but I found strings to be the best way to make the code obvious about what worksheet we were actively modifying).

I also did some work with tagged data (via tuples) so my library could choose which write function to invoke in xlsxwriter. I don't remember the motivation for that.

Post reply on HN