Microsoft is bringing popular programming language Python to Excel. A public preview of the feature is available today, allowing Excel users to manipulate and analyze data from Python.

You won’t need to install any additional software or set up an add-on to access the functionality, as Python integration in Excel will be part of Excel’s built-in connectors and Power Query. Microsoft is also adding a new PY function that allows Python data to be exposed within the grid of an Excel spreadsheet. Through a partnership with Anaconda, an enterprise Python repository, popular Python libraries like pandas, statsmodels, and Matplotlib will be available in Excel.

  • lud@lemm.ee
    link
    fedilink
    arrow-up
    34
    arrow-down
    1
    ·
    1 year ago

    Python calculations run in the Microsoft Cloud,

    Ah shit, so close.

    • Remavas@programming.dev
      link
      fedilink
      arrow-up
      6
      ·
      1 year ago

      I truly wonder why. I mean, others just package a python installation, but Microsoft wants to use the cloud. Very peculiar.

      • antlion@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        5
        ·
        1 year ago

        Probably to keep it proprietary. If they distributed Python with scientific packages it would be hackable, and they’d lose control.

  • xurxia@mander.xyz
    link
    fedilink
    arrow-up
    9
    ·
    edit-2
    1 year ago

    After preview it will be a paid subscription additional to Office365, the same strategy as Office Copilot. I hate this policy of pay for a product then still paid for more functionalities… at the end of the year you will have paid a lot.

    Microsoft says Python in Excel will be included in a Microsoft 365 subscription during the preview, but “some functionality will be restricted without a paid license” after the preview ends.

    • glockenspiel@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      Yeah this is typical Microsoft looking at ways to force people up the price ladder. They did it with Power Platform in very obvious ways. They have completely gutted things like Power Apps and Power Automate by making almost all functions non-delegable… unless you are a paying a premium on top of a premium for costly dataverses in which case more than like 7 functions are magically delegable again. But then there are the pay-per-user/pay-per-use connections to access your own data, even if you host it yourself as an enterprise.

      They should’ve been broken up in the late 90s.

    • intelati@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      I had mostly the same reaction. The back of the box reads okay, but the potential is worrying. Even as a “cybersecurity news rubbernecker” (Seriously Risky Biz podcasts)

  • whataboutshutup@discuss.online
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    But why? Excel is a shit way to work with big amounts of data due to it’s own format’s complexity and bloated software. It’s welcome to implement python, but that’s not what holds it down. Opening a big csv would crash it on the same machine that loads it with a python IDE in seconds. It’s not made for this. It’s like, nice, but the volume of information you need to make it matter would break Excel in halves.

    • gecko@programming.dev
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      edit-2
      1 year ago

      This feels like a really dated take to me. Leaving aside whether this was true in the past, in 2023, Excel is happy to open absolutely gargantuan files, and it’s quite speedy once it’s done so. You can even directly tie it to a database via ODBC if you want, and that works (albeit it obviously flattens the data out in the process, so goodbye foreign keys in any real sense). It also has tons of very easy-to-use data manipulation tools (pivot tables, tables in general, data extrapolation, graphs, etc.) that end up being wonderful complements to something like Python.

      Could you write a Python program that would run faster than pure Excel and do the same thing? I mean, probably (although Excel’s core execution engine is honestly pretty freaking fast). But could you write it as quickly? Maybe, maybe not. And certainly someone who knows Excel well would have an easier time adding a little Python to patch up any issues than rewriting the whole thing from scratch.

      tl;dr I think you’re not being accurate about contemporary Excel, and I separately suspect you’re not really the target audience here

      • Dr Cog@mander.xyz
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Could I write a Python program that does the same thing as Excel but faster?

        I don’t need to. It’s called pandas

      • rhymepurple@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 year ago

        I agree with all your points about Excel being capable. However, I’m struggling to think of examples where this newly announced Python integration within Excel would be helpful (with the exception of new/different visualizations) - especially for the reasons you stated about modern Excel.

        Are there any use cases that you can think of where someone who knows Excel well would resort to “adding a little Python to patch up any issues”?

        • GBU_28@lemm.ee
          link
          fedilink
          English
          arrow-up
          0
          ·
          1 year ago

          Maybe some sort of “team toolbox” of logical functions or something? I’ve seen some nightmare shops where big reports have a page of manipulations that get copied to new reports/projects every time, and each represents some sort of canned, core business logic.

          I dunno. I cant imagine how the code storage will go

          • rhymepurple@lemmy.ml
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 year ago

            The code storage for Python is no different than regular Excel functions (eg - VLOOKUP(), SUM(), etc.), meaning that it is stored within an Excel cell. The only differences are that Python code is run remotely vs Excel functions running locally and the location of Python’s code matters vs Excel’s functions are location agnostic (ie - Python code runs in cells located left-to-right, top-to-bottom but Excel’s functions can dynamically determine the calculation order/location).

            I’m not sure that this new Python integration changes much about this use case (except for another way to accomplish the same/similar tasks).

  • AutoTL;DR@lemmings.worldB
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    This is the best summary I could come up with:


    A public preview of the feature is available today, allowing Excel users to manipulate and analyze data from Python.

    “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,” explains Stefan Kinnestrand, general manager of modern work at Microsoft.

    Microsoft is also adding a new PY function that allows Python data to be exposed within the grid of an Excel spreadsheet.

    Python calculations run in Microsoft’s Cloud, with the results returned into an Excel worksheet.

    Excel users will be able to create formulas, PivotTables, and charts all based on Python data, with the ability to bring in charting libraries like Matplotlib and Seaborn for visualizations like heatmaps, violin plots, and swarm plots.

    Python in Excel is rolling out today as a public preview for Microsoft 365 Insiders in the Beta Channel.


    The original article contains 342 words, the summary contains 147 words. Saved 57%. I’m a bot and I’m open source!

  • Zeusbottom@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    Fantastic news. This will help me immensely!

    Having it run locally would be even more help for my use cases. I often have lists of IP addresses in my sheets, and it would be helpful to ping them directly from Python code. But I can work around that with fping or nmap.

    • rhymepurple@lemmy.ml
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      This integration won’t allow you to do that. Python will not run locally, but instead on Microsoft’s platform (likely Azure).

      If you’re just reading some simple data from Excel, there are several ways of accomplishing this already. For example, Pandas has read_excel() and there is also openpyxl. You could even use those tools to write the results back to Excel. Things get more complicated though if the Excel file is something more than just a simple list.