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
    52
    arrow-down
    1
    ·
    1 year ago

    Python calculations run in the Microsoft Cloud,

    Ah shit, so close.

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

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

      • PoorlyWrittenPapyrus@lemmy.world
        link
        fedilink
        arrow-up
        20
        ·
        1 year ago

        Running in the cloud is another reason to keep paying them every month in perpetuity, rather than just once. Helps keep revenues stable and indefinite.

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

          It also allows them to completely gate the feature via tiers, like they do with other things in their environment. I’ve written about Power Platform since it is a pretty accessible tool for a lot of people. But it is also a shining example of Microsoft’s almost microtransaction-like enterprise vision of the future. Everything is great in the preview. While they collect usage data. Then they tuck the most useful and common functionality behind various paywalls, including per usage paywalls. They leave just enough in the base tier to draw people in and get them committed to the platform.

          It will not surprise me in the least if basic features are removed and paywalled after the preview. It would not surprise me in the least if they repeat what they’ve already done and prevent users from using built-in python functions unless the user pays up.

          • Zron@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 year ago

            But they can’t stop me from importing CSV data that I make with regular python. MS loves legacy features almost as much as they love money, that’s why windows 11 still has the fucking control panel.

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

            Exactly why I hope it will flop and they decide it’s not worth the money. It’s disgusting how tech companies take something free and try to monetize it by hiding it under a veneer of “accessibility” and “integration”. One can only hope that information regarding FOSS will remain easily accessible and that the group this update is targeting is insignificant enough. I doubt any serious data scientist would opt to Excel + Python over just Python for big enough data sets, and the average Excel user, let’s face it, is unlikely to learn Python.

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

    • intelati@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      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)

  • THED4NIEL@lemmy.world
    link
    fedilink
    arrow-up
    21
    arrow-down
    1
    ·
    1 year ago

    Finally. Another step to automate my work.

    Excel formulas are way too limited and VBA is a nightmare to work with.

  • xurxia@mander.xyz
    link
    fedilink
    arrow-up
    11
    ·
    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
      5
      ·
      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.

    • runner_g@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 year ago

      💰💰💰 By sending every calculation to Microsoft servers they can log what your company is doing and sell that data to ad-agencies. Also it forces you into a subscription.

  • AutoTL;DR@lemmings.worldB
    link
    fedilink
    English
    arrow-up
    6
    ·
    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!

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

    As someone who is learning python, this is exactly what I was learning to code for. Are there any known resources or courses that specifically teach about python for excel or what you should learn t for this application? Libraries & dictionaries seem like a good start?

  • whataboutshutup@discuss.online
    link
    fedilink
    arrow-up
    6
    arrow-down
    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
      7
      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
        2
        arrow-down
        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

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

        I hear you.

        I don’t know how new Excel performes and I thought it’s the same as ten years ago - the version I’m trapped in. With people who obsessively try to drive it to the edge where it’s not responsive on average office PCs.

        But if it works well with various big spreadsheets now, it’s a wonder, with how many new people start to tackle programming with Python. I obiviosly won’t write a script faster than normal operational speeds of software, it’s just some tables ended up that big and broken I could only open them like that. But that, I guess, is exclusion?

        It’s just the issue of people using a microscope as a hammer when they need to break nuts.

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

          So, assuming you’re still on Office 2010, you’re missing (off the top of my head, but I believe these were all Excel 2013 or later):

          • Initial support for super-large spreadsheets, with accompanying perf improvements (this was maybe 2013?), and then lots more perf improvements in 2016 and 2019 as people started using those really big sheets;
          • Flash Fill support, which is kind of like an AI (not in the ChatGPT-sense)-powered fill down (so e.g., nowadays, if I enter “Sept 6th” and then “October 4th”, then it’ll offer a completion of November 1, since that’s the first Wednesday of the month);
          • Heavily improved Pivot Tables, including Slicers, Power Pivot, and Pivot Drill Down, which make exploring data a lot easier;
          • Forecasting tools; and
          • Much better Tables, making it a lot easier to write formulae entirely with named references rather than cell IDs There’s more, but that’s what I could remember off the top of my head/could quickly verify so I was sure I wasn’t misspeaking. LibreOffice Calc unfortunately also lacks basically all of these features (and the lack of Tables in particular means that OpenOffice sheets still have a lot of A2:A300 garbage where Excel would instead just have e.g. SomeTable[Heading]. E.g., an actual formula from a sheet I currently maintain to track my team’s sprints: =XLOOKUP([@Verified],SprintMeta[Start],SprintMeta[Sprint Name],"Unknown",-1). Python’s easier to read here, but this is honestly doing a lot while being surprisingly readable (especially if you’re familiar with XLOOKUP, which is basically how you do keyed array access in Excel)

          You have totally legitimate gripes about Excel; I’m not denying that. But I do think that you might be pleasantly surprised on newer versions.

    • LazaroFilm@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Because this may allow companies that are already using excel and not planning on changing to actually have a powerful programming language.

    • Teppic@kbin.social
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      I’d like to see it. VBA is actually brilliant, you can make very very portable applications with intuitive user input and output interfaces (i.e. a cell range in Excel, and and version of tables and graphs you like as outputs)… But realistically who wants to use BASIC these days?
      I usually say it in jest, but I’m not sure there is actually a better RAD (rapid application development) platform out there than Excel (with a bit of VBA as needed).

  • Zeusbottom@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    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.

    • misk@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      5
      ·
      edit-2
      1 year ago

      You do realize that in 2020 Microsoft hired Guido van Rossum who then resigned from Python steering committee elections?

      How would you even embrace, extend & extinguish an insanely popular programming language? For what purpose?

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

        How would you even embrace, extend & extinguish an insanely popular programming language?

        Remember this? Remember that time Google and Apple entered web standard organisations to pump out harmful APIs?

        The extinguish part isn’t necessarily about literally wiping out a project.

        • misk@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          2
          ·
          edit-2
          1 year ago

          You don’t need to convince me web is currently at risk of repeat of what we had in late 90s. It doesn’t really have many similarities to what’s happening here because corporate entities are in almost complete power over JS interpreters/compilers due to how web browsers are in position to capture market.

          What Microsoft does here is adding another scripting language to Excel because VBA is outdated shitshow that creates enormous barrier of entry for millions of people that could get way more out of their flagship product. There is a genuine benefit to Microsoft and Excel users to add Python scripting.

          Python is a general purpose / glue language for countless useful libraries and APIs. Excel will be one of many big fishes in that pond, among Tensorflow by Google, PyTorch by Meta and plenty of others. There’s nothing to be gained from breaking Python here. There’s also no room to strong arm non-corporate part of Python world into anything because we’re not married to any particular implementation.

          Microsoft, like most big corporations, is Inherently evil, but not every single thing they do is evil. I’ve worked in enough big corporations to know that they’re so disorganized that you should look at what particular departament does because left hand doesn’t really know what right hand does. Excel team has been incredibly customer facing and deserves benefit of the doubt.