Live data from Hacker News

Microsoft is bringing Python to Excel

theverge.com

431–440 of 455 posts

Re: Microsoft is bringing Python to Excel

#431
post #373

Earlier quoted context omitted.

> Do you _really_ think I've spent the past 10 years getting files like this and I still don't understand the reason. I didn't ask for an explanation. I asked for a fix. I don’t believe you’ve been doing it that long and haven't found the fix. Apply appropriate formatting if you have long strings of numeric digits [as long as they can’t have leading zeroes] that you want stored as numbers but displayed without scient…

I cannot remember the last time I had some long number and thought to myself, "You know what will be helpful, convert this number into scientific notation!"... It's asinine Excel has this behavior with any large number. Try to work with a list of EAN/UPC codes... it'll wreck every single one every single time, unless you take significant care to guard against it via formatting, special characters that trick it into u…

> I cannot remember the last time I had some long number and thought to myself, "You know what will be helpful, convert this number into scientific notation!"...

Okay, so set formats appropriate to what is useful for your data.

Defaults don't cover all cases, otherwise there would be no non-default options.

> It's asinine Excel has this behavior with any large number. Try to work with a list of EAN/UPC codes...

Codes aren’t numbers they are strings, even if the code is a sequence of digits. They should be formatted as text. For actual numbers that shouldn't be displayed in scientific missions, the appropriate numeric format does that.

> it'll wreck every single one every single time

If its any code that can be safely stored as a number, it won't wreck it. It’ll just look bad until its fixed. If it, say, has significant leading zerores, yes, it’ll wreck it, because excel defaults to dealing with numbers, not text, and there is a difference between text made up of digits and actual numbers.

> unless you take significant care to guard against it via formatting, special characters that trick it into using a string, etc

Knowing the shape of data you are entering and selecting a column and applying an appropriate format (including “text” as an option) before you enter any data (usually, to a whole column) isn’t that arduous.

Re: Microsoft is bringing Python to Excel

#432

Earlier quoted context omitted.

If you're getting aggregates, it's not the raw data by definition. Someone set up aggregation for you to use, much like I described.

I didn't mean aggregate as in summarized data, but aggregate as in a common repository of multiple different data sources as a single massive data warehouse. If I needed to group or summarize the data, I had to do it in my own queries.

My point wasn't that you should never give people access to raw data, but that the raw data won't fit in excel rows. You have to do aggregation or filtering somewhere to get the data within the row limit.

Re: Microsoft is bringing Python to Excel

#433
post #370
post #49

Earlier quoted context omitted.

Hi I work on Excel, can you write a summary of why that's important to you and send it to bgruenbaum@microsoft.com ? I'll get it in front of a PM. Alternatively PMs read all the feedback sent via the feedback UI on Excel web and desktop so you can use that instead if you prefer.

How about an actual API that lets you drive Excel from Python rather than the other way around? With that API, it won't matter whether you want Python, Ruby, Lua, whatever, for your scripting language. This is nice, but it welds a specific version of Python inside Excel and makes it a gigantic PITA to use your normal development tools on your Python code.

Completely agree. MS should just do Google Apps Script but better.

Re: Microsoft is bringing Python to Excel

#434

Earlier quoted context omitted.

A complication here is how large the Python distro this appears to be using is. I don't know if you've ever set up a container with all of anaconda, scikit, statsmodels, pandas, Matplotlib, seaborn, and more but it gets pretty big. A lot of people would complain about the bloat if Excel installed it by default. Another complication is they claim the container isn't just "a docker container", but for increased securit…

How large is pretty big? And who said it must be installed by default? Hyper-V is enabled by default on supported hardware.

> How large is pretty big?

Python data science containers are on the order of GBs.

> And who said it must be installed by default?

I did end my comment with thoughts that I think it would be nice to have as an optional install. Mentioning why it isn't likely a default install is relevant because they want this Python feature to be accessible to everyone and they want people to collaborate and the UX for an optional install isn't what they were looking for and would complicate things. (That's not an argument against also supporting the optional install, but a reasoning for why the optional install is a harder feature to support and doesn't make the "version 1" cut.)

Re: Microsoft is bringing Python to Excel

#435
post #421

Earlier quoted context omitted.

A complication here is how large the Python distro this appears to be using is. I don't know if you've ever set up a container with all of anaconda, scikit, statsmodels, pandas, Matplotlib, seaborn, and more but it gets pretty big. A lot of people would complain about the bloat if Excel installed it by default. Another complication is they claim the container isn't just "a docker container", but for increased securit…

Yeah my day job involves deploying Python containers to K8s so I get where you are coming from. GB sized images are not uncommon. However: 1 - That could be an optional component, behind a "Install Python for Excel " button. 2 - You need to install Python to code in Python anyway, with or without Excel. 3 - Bloat is the norm nowadays and I'm not sure whether users care. A clean Visual Studio install takes 10 GB of di…

1) I agree, which is I why I did end my comment that I think it would be nice to see an optional install offered for offline usage.

4) I don't think they are using Docker, but they are using containers. (They mention running directly on top of Hyper-V so they might not even be considered by some developers as containers in the Docker sense but closer to "mini" VMs.) The container they are using for security/sandboxing reasons. The Excel team likely still has nightmares from the worst years of VBA macro malware and this Python system seems built specifically to sandbox all the running Python code to an execution environment (container/VM) that is easy to refresh/rebuild/recycle/tear-down. I agree that Python on Windows is usually great and most of the Python ecosystem is great at cross-platform support, but I also understand why Excel would want to sandbox any Python it runs to containers that are isolated from the host machine/user and it can easily reboot.

Re: Microsoft is bringing Python to Excel

#436
post #289

Earlier quoted context omitted.

Oh this must be Felix! I saw and played with xlwings many years ago and was impressed :) Agreed with the friction around getting started. I would like to see it reduced. It’s cool to see you using them to wrap Python functions - I have done something similar before myself, and still need to get around to shimming Haskell into excel at some point. Another thing I don’t like is how JavaScript Custom Function cell formu…

It's me, yes, are you Michael then ;)? Yeah, I love the Office.js platform, I believe it's the most versatile extension platform there is, it just came out during an unfortunate time (when people believed that you can't use JS without React anymore ;) Anyhow, the magic of Office.js is that you can use it like a JS framework with total freedom what you use on the backend (it's just a fetch call away), so whether that…

I’m not Michael - presuming you are referring to Michael the PM. I was a dev. I’ll add you on LinkedIn.

Great to here you praise auth. I almost forgot getting auth ‘right’ inside Excel was a real time burglar.

Re: Microsoft is bringing Python to Excel

#437

Earlier quoted context omitted.

Which part do you find difficult? The web backend or the deployment of the Manifest.xml via the app store / office admin?

The app store / Office admin stuff. When I was dealing with this stuff 2 years ago, it was insanely difficult to deploy a web add-in internally (something involving the "Microsoft 365 admin center"), let alone deploy it to customers (gotta get approval to deploy it in the special Office app store, and hope+pray that your customers' IT departments don't block that). Compare to VSTO, where IIRC installation just involv…

You just reminded me I tried to make an office addin a few years back and distribute it on the office store. Terrible experience trying to get Microsoft’s admin/business center (whatever it is/was called) to verify I was actually a real human/owner of the domain as a sole proprietor. Terrible.

Re: Microsoft is bringing Python to Excel

#438
post #369
post #361

Earlier quoted context omitted.

It doesn't include other random data. You select N rows, contiguous or discontiguous, and those are copied to N consecutive rows starting at the paste point.

It includes things that aren't selected, which is other random data. If I select, copy, and paste, the only desirable outcome is that I get a copy of my selection.

I don't understand what you mean. In my example I select the cells that contain 1, 2, 3, 7, 8, 9, a, b, c, then copy, then go somewhere else and paste, and Excel pastes 1, 2, 3, 7, 8, 9, a, b, c. I don't see an other data.

Re: Microsoft is bringing Python to Excel

#439
post #325

Earlier quoted context omitted.

7.5.5.2 on MacOS.

The only thing I can think of is macOS clipboard manager somehow interfering with the copied data. Was testing on Linux kf5 UI. Also, I can preserve the empty row, if I paste with Ctrl+Shift+Alt+V (Edit - Paste Special - Paste Unformatted Text). This opens the Text Import dialog.

You've solved it!

I turned off the clipboard history app I use and now LibreOffice pastes like Excel.

The history app I use is 10 years old and I see that the company that made it apparently is no longer around (or at least their domain no longer works) so I guess I should get a newer clipboard history app.

Re: Microsoft is bringing Python to Excel

#440
post #439

Earlier quoted context omitted.

The only thing I can think of is macOS clipboard manager somehow interfering with the copied data. Was testing on Linux kf5 UI. Also, I can preserve the empty row, if I paste with Ctrl+Shift+Alt+V (Edit - Paste Special - Paste Unformatted Text). This opens the Text Import dialog.

You've solved it! I turned off the clipboard history app I use and now LibreOffice pastes like Excel. The history app I use is 10 years old and I see that the company that made it apparently is no longer around (or at least their domain no longer works) so I guess I should get a newer clipboard history app.

Great to hear :)

Re: a new clipboard app, I often see people recommending CopyQ, which is cross-platform: https://github.com/hluk/CopyQ

Post reply on HN