Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Microsoft Python

Microsoft Announces Python In Excel 92

theodp writes: On Tuesday, Microsoft announced the Public Preview of Python in Excel, which "runs securely on the Microsoft Cloud".

From the Home Office in Redmond: "Python is one of the most popular programming languages today, loved by businesses and students alike and Excel is an essential tool to organize, manipulate and analyze all kinds of data. But, until now, there hasn't been an easy way to make those two worlds work together. 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. Python in Excel combines Python's powerful data analysis and visualization libraries with Excel's features you know and love. You can manipulate and explore data in Excel using Python plots and libraries, and then use Excel's formulas, charts and PivotTables to further refine your insights...We're partnering with Anaconda, a leading enterprise grade Python repository used by tens of millions of data practitioners worldwide. Python in Excel leverages Anaconda Distribution for Python running in Azure, which includes the most popular Python libraries such as pandas for data manipulation, statsmodels for advanced statistical modeling, and Matplotlib and seaborn for data visualization....While in Preview, Python in Excel will be included with your Microsoft 365 subscription. After the Preview, some functionality will be restricted without a paid license."

Python creator Guido van Rossum, now a Microsoft Distinguished Engineer, helped define the architecture for Python in Excel and had this to say: "I'm excited that this excellent, tight integration of Python and Excel is now seeing the light of day. I expect that both communities will find interesting new uses in this collaboration, amplifying each partner's abilities. When I joined Microsoft three years ago, I would not have dreamed this would be possible. The Excel team excels!"
This discussion has been archived. No new comments can be posted.

Microsoft Announces Python In Excel

Comments Filter:
  • Right? Why is the doom music playing...?
  • Alternate title (Score:5, Informative)

    by The Evil Atheist ( 2484676 ) on Tuesday August 22, 2023 @09:44AM (#63787768)
    Excel finally catches up to LibreOffice.
    • by AmiMoJo ( 196126 )

      This is potentially a big deal because until now there has been no widely adopted open standard for programming in spreadsheets. LibreOffice uses Python, Google Sheets uses Javascript, and Excel uses VB Script. Software written for one is not portable to the others.

    • If only LibreOffice catches up to Excel in almost everything else I need.

      • Sounds like you're over-reliant on a spreadsheet, to be honest.

        I sincerely hope you're not doing something actually important, like scientific data processing, or COVID tracking.
  • Hurl (Score:5, Funny)

    by slack_justyb ( 862874 ) on Tuesday August 22, 2023 @09:53AM (#63787796)
    Quote: With Python in Excel, you can type Python directly into a cell, the Python calculations run in the Microsoft Cloud, and your results are returned to the worksheet, including plots and visualizations. Hooray! Thatâ(TM)s exactly what I wanted. For all my calculations to be ran on someone elseâ(TM)s computer! So they didnâ(TM)t add Python to Excel, they just enhanced the web client that handles WEBSERVICE (https://support.microsoft.com/en-us/office/webservice-function-0546a35a-ecc6-4739-aed7-c0b7ce1562c4) to automatically wrap Python and send it off. Gotcha!
    • Wow Slashdot handles iPhone incredibly well.
      • by Pascoea ( 968200 )
        It's only been an issue since 2017, gotta give them a little time to add full unicode support.
        • I can hear msmash typing furiously to make productive use of this new Excel feature. Did you know that Slashdot's back-end (or hind quarters as we techies like to say) is one of the world's seven most complex spreadsheets?
    • Quote: With Python in Excel, you can type Python directly into a cell, the Python calculations run in the Microsoft Cloud, and your results are returned to the worksheet, including plots and visualizations. Hooray! Thatâ(TM)s exactly what I wanted. For all my calculations to be ran on someone elseâ(TM)s computer! So they didnâ(TM)t add Python to Excel, they just enhanced the web client that handles WEBSERVICE (https://support.microsoft.com/en-us/office/webservice-function-0546a35a-ecc6-4739-aed7-c0b7ce1562c4) to automatically wrap Python and send it off. Gotcha!

      Microsoft's response would likely be a query as to why any plebe would want to use Excel on their own computer when the cloud version sorta/kinda works some of the time to do the same things, plus EVERY keystroke can be tapped for juicy data streams... er, um, I'm sure they would mean to say that they can keep it all forever backed up for you on their fair to middlin' attempto to mimic what unix network filesystems have done since the dawn of the computer age, and somehow still managed to fail to imitate.

      • Wait what is an "own computer"? Are you saying you're computer is not just a remote desktop interface into a cloud hosted Windows 365 instance?

    • by caseih ( 160668 )

      Actually one of the coolest things I ever saw was a spreadsheet based on Python where python was the expression language for formulas in cells. Was pretty neat, especially when you pull in the power of all the common libraries, as well as Python types.

  • will you be billed for XX run time?

  • That's funny (Score:3, Interesting)

    by Waffle Iron ( 339739 ) on Tuesday August 22, 2023 @10:02AM (#63787818)

    The ironic thing about this story for me is that almost everything that I would have done in a spreadsheet a few decades ago, I now do by writing a quick standalone Python script.

    I keep the input data separate from the logic, often in CSV, JSON or something similar. The logic also isn't hidden and spread out under countless cells, doing magic references to informative names like $G6, or needlessly duplicated in arrays of the same expression. All of this also works better with version control than saving a binary spreadsheet file.

    Sometimes I do load the output into a spreadsheet if I need to do a quick graphical plot of the results, but that's mainly because I'm too lazy to learn a real plotting application.

    • Re:That's funny (Score:5, Insightful)

      by Monkey-Man2000 ( 603495 ) on Tuesday August 22, 2023 @12:09PM (#63788150)
      Check out Matplotlib [matplotlib.org] and Seaborn [pydata.org] for real plotting. It's funny, but not surprising, that MS is adding matplotlib to Excel since Excel produces some of the most butt-ugly graphs imaginable. The examples in both the above galleries have pithy Python code to produce the plots, so what I typically do is just find a plot style I like, copy-and-paste, and edit to fit my data into it. Brilliant!
    • The work Guido did in making comprehensions so powerful maps them almost completely to SQL, so I have always though there is a natural fusion between python and database data. This is especially true with generators, which are lazy iterators utilizing yield statements to stream data on reading. I think it is possible to make a symbolic calculus of these classes, which correspond to SQL statements, and can be optimized for performance after completed, as they are only read on iteration. So with some really m

    • ... a quick standalone Python script.

      I usually do my my calculations in Excel, it's more visual as I can see the answers, all at once, and thus see what I need to calculate next (Obviously not suitable for large-iteration loops). Also, like maths, a cell can't modify itself.

  • Python is good, the cloud is bad, very bad
    It's a trap, run away!
    The cloud is NOT your friend

    • by smooth wombat ( 796938 ) on Tuesday August 22, 2023 @11:58AM (#63788132) Journal

      Burma Shave

    • Except for the most trivial of Python applications, each one carries a boatload of dependencies riding upon a rainbow of Python releases and packages. For a specific application to run, Python must be at a specific dot release, and the packages it depends on must be within a narrow band of releases, sometimes just one specific release will do. As a result, I've lost count of how many pyenv instances with Python virtual environments inside them I've had to spin up over the years.

      Maybe Excel deals with this b

      • by ciurana ( 2603 )

        Maybe Excel deals with this by giving you just one Python release to use with Excel along with a curated set of packages with stable interfaces. Maybe you get just one release of Python with no packages. Or then again, maybe you get the whole jungle to explore! I'm not going to try it to find out, so I'll leave that as a mystery whose murky depths the reader may plumb as they wish.

        Another danger is the "running in the cloud" bit. Well, that's nice just so long as you've got working internet connection. Sometimes, even the most well connected of us don't. Guess that's just too bad.

        Extrapolating from the announcements, and knowing Anaconda is involved, they are locking a given tool set (package versions) that are known to work well together, much like Jupyter works. This guarantees that, for the versions available, everything will work well together. It may also hinder the ability to add new or updated packages (e.g. SARIMAX if it's not available in the standard distribution). The user may have little to no control over adding packages and importing them to Excel/Python code.

        As for

        • As for running in the cloud -- this is a very elegant solution to very large data problems.

          Elegant isn't the word I'd choose. I'd tend more towards one that simultaneously expresses both vendor lock in and satisfaction of an urge to rent seek. Enshitification does nicely

    • Python is bad too.

      So it's just bad.

  • Uh oh (Score:3, Funny)

    by RitchCraft ( 6454710 ) on Tuesday August 22, 2023 @10:06AM (#63787826)

    There's a snake in my boot!

  • Now excel can mine bitcoins, format your hard drive, and install root kits
  • "... your scientists were so preoccupied with whether or not they could that they didn't stop to think if they should." - Dr. Ian Malcolm
  • by Major_Disorder ( 5019363 ) on Tuesday August 22, 2023 @10:17AM (#63787848)
    "runs securely on the Microsoft Cloud"

    Stop it, you're killing me.
  • by Scoth ( 879800 ) on Tuesday August 22, 2023 @10:23AM (#63787856)

    Is this the latest evolution of Zawinski's Law? (Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.) It seems like everything is slowly incorporating python one way or another.

  • New data mining (Score:4, Interesting)

    by Causemos ( 165477 ) on Tuesday August 22, 2023 @10:25AM (#63787862)

    With potentially large quantities of data being send to the cloud for processing, this does seem like a gold mine for data mining (or exploits).

    • With potentially large quantities of data being send to the cloud for processing, this does seem like a gold mine for data mining (or exploits).

      Possibly even an interesting way to DDoS the MS cloud.

    • Ever hear of a National Security Letter?

      • Ever hear of a National Security Letter?

        No, but the picture of a bird I've attached to this comment will disappear if I ever get one.

        • Ever hear of a National Security Letter?

          No, but the picture of a bird I've attached to this comment will disappear if I ever get one.

          It just turned into an X. Should I call Elon?

          • Ever hear of a National Security Letter?

            No, but the picture of a bird I've attached to this comment will disappear if I ever get one.

            It just turned into an X. Should I call Elon?

            Only if it's a 10,000,000 lumen flashbulb shining directly into your apartment window.

    • The overwhelming majority of Excel data is completely meaningless without the necessary context to understand what the heck numbers means and what we are attempting to do with them. Excel spreadsheets are not lengthy word documents describing themselves, quite the opposite, they are completely useless without a deep existing understanding of the content.

      The entire freakout of datamining reminds me of the current state of data in the world. Google knows everything about you. Facebook knows everything about y

  • Hooray! (Score:5, Funny)

    by Chris Mattern ( 191822 ) on Tuesday August 22, 2023 @10:26AM (#63787868)

    Now Excel can do for Python what it did for Basic!

  • by Laxator2 ( 973549 ) on Tuesday August 22, 2023 @10:44AM (#63787914)

    At the time I was using PyXLL (https://www.pyxll.com/) to execute Python code as it was so much better than VBA.
    I believe Ballmer was CEO at that time and he did not pay any attention to Open Source, hence no Python in Excel.
    Maybe the market share of Excel is slipping or Nadella is looking to monetize yet another Open Source project after successfully monetizing Linux by running Azure on it.

  • Using Python to print 2/3 in Microsoft Excel, clearly the mark of the beast.

  • by Anonymous Coward on Tuesday August 22, 2023 @11:16AM (#63788004)

    So you send the spreadsheet to someone else and it breaks?

    While in Preview, Python in Excel will be included with your Microsoft 365 subscription. After the Preview, some functionality will be restricted without a paid license."

    First, as described it's not "Python in Excel", it's "Cloudy Python called from Excel".

    So, you email the spreadsheet, maybe to another department or company, but the recipient doesn't have the right license or their firewall doesn't allow random spreadsheets to directly access the internet, and it's broken. Obviously broken (informative error message), less obviously (obscure error message) or subtly broken (wrong results)?

    • by Junta ( 36770 )

      But what can you do? Mere laptops can't possibly run something as complicated as a python command. You absolutely need a few racks of equipment ready to run your dinky little python expression.

  • Many years ago, I wrote a fairly short program that worked like a basic spreadsheet, but in the cells you put a python code that returned the cell's contents.
    This let you do complex operations based on the values of other cells and it could change other cells so it was like a Turing machine with self modifying code and a 2D tape. It was not at all polished, but as a proof of concept it worked very well, albeit very slowly and in a memory hogging sort of way.
    I should have put it up on github, but I lost it when I left my employer and forgot to save a copy.
    It wouldn't take long to recreate.

  • Rather than requiring the cloud, I'd have thought they could've squeezed a local python install in there without anyone noticing the relatively tiny increase in footprint.

    • Rather than requiring the cloud, I'd have thought they could've squeezed a local python install in there without anyone noticing the relatively tiny increase in footprint.

      I suspect it's part of a longer term play for Access Db integration.

      For the amounts of data you deal with on spreadsheets the vast majority of desktops have enough power. But if you start working with a database now you may want some cloud power, particularly if the DB is already on the cloud.

      I think the goal here is to start training the user base and ironing out the workflow for a pure cloud experience where processing is fired off to the cloud (for lots of $$).

  • by bugs2squash ( 1132591 ) on Tuesday August 22, 2023 @12:18PM (#63788180)
    Will this also bring better excel integration into python?
    The excel modules I've used so far have had some issues (I may be lagging the latest versions) but they seem to be based on reverse engineering excel to some degree - if microsoft were to release an excel module it would presumably be an improvement.
  • I would just grid up a bunch of 0 length arrays. Yep, cell upon cell of just 0 length arrays....

  • Its already cross platform, .net, easy to use...what the heck.

    • by Junta ( 36770 )

      It lost the popularity contest.

      *Particularly* in any numerical analysis field, no one is even vaguely thinking of or enabling PowerShell.

      About the only powershell I see in the wild is for Windows systems administration (yes, they have a linux version, and I did install it... to help guide a windows user that insisted on powershell). A Powershell user may avail themselves of decent parsing and http interaction, but again mostly toward the end of managing IT resources.

      Also, cross platform doesn't even matter

  • There's no possible way that this isn't going to get exploited within the first 4 seconds of it's existence, and won't get properly patched for a decade.
  • This will be disabled by default and hidden under Protected Mode, right? Otherwise this is a hacking wet dream.

  • We need Outlook (365) to know about Excel spreadsheets that are attachments to emails. Even if they aren't in your inbox. It should "run" each spreadsheet (calling any registered Python callbacks in the spreadsheet) every couple of hours. This would be useful for all those people who believe using spreadsheets for bug tracking or project management is a good idea. Especially when people each have their own copy and like to say "Well, in MY email I'm using version xyz." Imagine the fun of being able to

  • by kopecn ( 1962014 )
    Python3 -m pip uninstall excel
  • You can write your entire application in A1 cell, using pandas and numpi and never have to work on excel!
  • Embrace, Extend, Extinguish.

    How long before Microsoft adds some "python" features that work only on their software ?

  • by gweihir ( 88907 ) on Tuesday August 22, 2023 @03:50PM (#63788776)

    That one where the had a master-key with massive privileges stolen recently? And did not notice? And the key was expired and still worked anyways? And it was a key for private users and allowed access to corporate users and, it seems, _all_ of them? That key that anybody halfway competent would have put in a HSM, but that apparently was just used in ordinary VMs? That cloud?

    The only question is whether they are now utterly deranged at MS or think their customers are completely stupid. Well, maybe both.

  • When Python 4 is suddenly the default(recommended) non-option that alters the interpretation of whitespace indentation in new and unpredictable ways.

  • Excel's features you know and love

    Like for instance its appetite to ruin your data [theverge.com].

  • by trawg ( 308495 ) on Tuesday August 22, 2023 @04:58PM (#63788920) Homepage

    Does this mean the Python isn't actually /in/ Excel, but instead all your code & data is getting pushed to some cloud service where the Python is executed and then the results returns?

    I mean this sounds cool at a high level but, uh, less cool if it's not running locally on my actual machine.

  • "Microsoft Announces Python In Excel"

    Lol, is it April 1st again already?? Ha ha you guys come up with the craziest stuff!!

  • So if you're on a plane and don't want to pay for wifi, or in a high security environment that won't let your computer get to the internet, or at a remote location. Yes, there still are places where you don't have wifi everywhere.

    • If you're on an airplane, you can just fly through the cloud and reach out the window to get a connection to Microsoft.

  • Back in the day, when Microsoft used VisualBasic to unify the Office suite, it was a game changer that essentially killed Borland. To my mind, it makes sense to move to Python, which is rapidly becoming one of the more popular programming languages - and one which is known for its ease of use.

GREAT MOMENTS IN HISTORY (#7): April 2, 1751 Issac Newton becomes discouraged when he falls up a flight of stairs.

Working...