Microsoft teases Python scripting in Excel
- Reference: 1692733207
- News link: https://www.theregister.co.uk/2023/08/22/python_excel_anaconda/
- Source link:
Sorry, Visual Basic.
"Today, we are excited to introduce the public preview of Python in Excel – making it possible to integrate Python and Excel analytics within the same Excel grid for uninterrupted workflow," said Stefan Kinnestrand, general manager of product marketing at Microsoft, in a [1]blog post .
[2]
To make this happen, Microsoft has partnered with Anaconda, which is providing its data science-oriented Python distribution, including popular libraries like Pandas and Matplotlib.
[3]
[4]
“I am thrilled to announce the integration of Anaconda Distribution open data science platform for Python into Microsoft Excel – a major breakthrough that will transform the workflow of millions of Excel users around the world,” gushed Anaconda CEO and co-founder Peter Wang, in [5]a statement .
“This integration represents a significant milestone that accelerates the adoption of Python and fulfills a long-standing request from our community."
[6]
The hope is that easy access to Python will let Excel users create more sophisticated visualizations, data manipulation, analytics, and machine learning models with their spreadsheet data.
[7]Updated Python support in VS Code brings browser editing and ditches open-source language server for Pylance
[8]SAS backs Python as alternative to its own language
[9]Fed up with Python setup and packaging? Try a shot of Rye
[10]Thinking about upgrading to Debian Bullseye? Watch out for changes in Exim and anything using Python 2.x
Anaconda's Python will live in a cozy, temperature controlled Microsoft Azure environment. The rationale for doing so is that this keeps Excel users from having to manage the potential complexity of Python configuration on a local machine.
Also, the cloud habitat for Anaconda's Python will presumably be more secure than having Excel users downloading libraries on their own. Having anticipated concerns about enabling yet another attack vector in Excel, Microsoft has preemptively declared that its snake has been tamed.
In [11]a post on data security and Python in Excel, Redmond lists the following plus points.
Excel's Python code runs on hypervisor isolated containers built on Azure Container Instances.
The container has Python and a curated set of secured libraries provided by Anaconda.
The Python code does not have access to the user's computer, devices, account, the network, any user token, or workbook properties, including formulas, charts, PivotTables, macros, and Visual Basic code.
Python developers have long been able to craft code that reads and writes data to and from Excel spreadsheets via libraries like [12]OpenPyXL . But Microsoft appears to be betting that its backend management and code-ready spreadsheets will be a more appealing option.
Writing Python code in the Excel public preview – currently available through the beta channel to those in the Microsoft 365 Insiders program, and coming first to Excel for Windows, build 16818 – is simply a matter of invoking the Python function ( =PY ) and writing Python code in that spreadsheet cell.
"Python in Excel uses the custom Python function xl() to interface between Excel and Python," Microsoft [13]explains in its documentation. "The xl() function accepts Excel objects like ranges, tables, queries, and names."
[14]
Importing external data can be done with Excel's built-in connectors and [15]Power Query , Microsoft's data manipulation tool.
As this is just a public preview, Kinnestrand said users should expect further improvements related to editing, like autocomplete and syntax highlighting, error behaviors, and so on. Presently, he said, there are data size and compute limitations to prevent abuse, which is to say excessive demands on Microsoft Azure resources. ®
Get our [16]Tech Resources
[1] https://techcommunity.microsoft.com/t5/microsoft-365-blog/introducing-python-in-excel-the-best-of-both-worlds-for-data/ba-p/3905482
[2] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2ZOUwBTrihatoY9uoqYVAEwAAAsk&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZOUwBTrihatoY9uoqYVAEwAAAsk&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33ZOUwBTrihatoY9uoqYVAEwAAAsk&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[5] https://www.anaconda.com/press/anaconda-distribution-for-python-brings-data-science-to-hundreds-of-millions-of-microsoft-excel-users
[6] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZOUwBTrihatoY9uoqYVAEwAAAsk&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[7] https://www.theregister.com/2021/09/07/python_extension_vs_code_september/
[8] https://www.theregister.com/2022/05/11/sas_python_support/
[9] https://www.theregister.com/2023/05/04/a_python_tool_called_rye/
[10] https://www.theregister.com/2021/07/26/debian_bullseye_release_set_for/
[11] https://support.microsoft.com/en-us/office/data-security-and-python-in-excel-33cc88a4-4a87-485e-9ff9-f35958278327
[12] https://openpyxl.readthedocs.io/en/stable/
[13] https://support.microsoft.com/en-us/office/getting-started-with-python-in-excel-a33fbcbe-065b-41d3-82cf-23d05397f53d
[14] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33ZOUwBTrihatoY9uoqYVAEwAAAsk&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[15] https://powerquery.microsoft.com/en-us/
[16] https://whitepapers.theregister.com/
Re: Nice in concept but...
I can see why they'd not want to let Python loose inside Excel, on customers' PCs, able to cause havoc. But yes, shoving it up in t'Cloud is going to be annoying.
Or, could be useful: "Wiggins!" bellows the boss, "Where's your end of year sales figures? They'd better be good mind you, or your for it
Re: Nice in concept but...
Now that you mention it, yes, Rube Goldberg -- master of wildly complex "solutions" to simple problems -- would no doubt find much to admire in the computation of spreadsheet cell using a distant computer and an elaborate communication network.
BTW, I'm pretty sure that Open Office has had Python scripting in Calc for a LONG time. My vague impression is that it works fine (and without the cloud) but isn't very useful for most people most of the time.
I'd rather prefer powershell in Excel
Just my opinion though. Would finally fix the powershell <-> excel bridge much better. And I could stick to use "english" and programming language. Anyone who has ever seen those horrible translations of the excel language (if then sum etc formula words) translated into their native language, here German, knows what I talk about. I cannot handle the translated programming language, especially since I started with MS-basic 2.0 and 3.5 on 6502 / 7501 CPU, and no easy way to turn it to "use english function names dammit" there. Something libreoffice can.
Something libreoffice can.
Something else LO can do: [1]Python macros . No fekkin cloud required :)
[1] https://help.libreoffice.org/latest/en-US/text/sbasic/python/main0000.html
Re: Something libreoffice can.
Libreoffice does not need a cloud to do this as there is no intention/plan to charge you lots of $$ to do this.
Snakes on a dataframe
Snakes?
Or worms?
Aaaaaaarrrrrrrrgggggghhhhhhh!
Oh dear holy $DEITY, no!!!!!
Re: Aaaaaaarrrrrrrrgggggghhhhhhh!
Ok, I've read that they've gone and containerised it a long, long way away in the cloud. But, I honestly don't get the point. If you're going to program in Python, just use Python. Surely, the Excelness of the experience would simply be an embuggerance for the Pythonista, and the Pythonness of it won't help anyone just wanting to use a few simple formula... And the portability of the end result is...... nil.
Re: Aaaaaaarrrrrrrrgggggghhhhhhh!
Or it is step 1 of 'Embrace, Extend, Extinguish'
Wait until you see "Visual P++"...
Re: Aaaaaaarrrrrrrrgggggghhhhhhh!
Wait until you see "Visual P++"
If I weren't so jaded, that thought would have me twitching. If I were fickle, the actuality would have me heading to Beachy Head.
cloudy 'security'
"the cloud habitat for Anaconda's Python will presumably be more secure than having Excel users downloading libraries on their own. Having anticipated concerns about enabling yet another attack vector in Excel, Microsoft has preemptively declared that its snake has been tamed.'
HA HA HA HA (oh wait, they're serious; let me laugh even HARDER!)
What part of THIS is 'more secure' ?
* Data stored in the cloud where governments and evil hackers can view it
* relying on "their server" performance including the pipeline to/from it
* DDoS, downtimes, network problems, MItM and DNS cracks, etc. NEVER HAPPEN, right?
More exist but another post near the top hit on the best ones
Pandas and Anaconda
Given the repeated references to Pandas and Anaconda, I suspect that what this is really about is using Excel as a front end to Pandas (a major Python data analysis library).
Pandas is so important and so widely used in certain fields of application (data science, machine learning) that people are learning Python just in order to be able to use it. People who had previously used Excel for certain small to medium size tasks are dropping it in favour of Pandas when Excel starts to run out of steam on really big tasks. The data and calculations will reside in Pandas, while Excel is used for data entry and reporting.
Given this, the way that Microsoft can respond is to build Pandas access into Excel. In order to do this they need to add Python scripting into Excel. They then run the calculations in the cloud because the really lucrative (for Microsoft) applications will be ones which are too big to run on a PC.
I suspect they will eventually offer tiered accounts, with prices escalating with cloud instance size.
Nice in concept but...
I love the idea of being able to use python instead of their terrible BASIC (VBA), but now /every single/ python calculation in the spreadsheet gets sent to TEH CLAUDE and back?
So now even simple spreadsheets are network chatterboxes and don't work at all if you don't have network access, like on a plane or way the eff out in the field, or maybe your ISP is just having yet another outage.
The obvious reasoning for this is so they can have a peek at your data and even more so they can charge you fat subscription fees for it. They're trying to make Office entirely cloud hosted anyhow (so you can't even run it locally) so this would be one more step towards that.