• 1 Post
  • 17 Comments
Joined 3 years ago
cake
Cake day: November 29th, 2021

help-circle
  • That’s true, but how often have you heard a finance team member wanting a CSV file so they can more easily process the data using Pandas or visualize it with MatPlotLib? How many accountants or finance people (especially those that ask for everything in Excel) do you know that is comfortable writing even a single line of Python code? How many of the finance team’s Excel-based tools will Python integrate well with? What feature(s) does Python within Excel provide that Excel (formulas, pivot tables, VBA, Power Query, Power Pivot, etc.) does not provide that someone on the finance team would need? What advanced charting/dashboarding functionality does Python in Excel provide that isn’t better accomplished in PowerBI (if not handled by standard Excel charts/graphs)?

    Don’t get me wrong - Microsoft’s implementation of Python in Excel has its merits and will solve some problems that otherwise would not be possible in Excel and will make some people happy. However, this is not the solution most people were expecting, asking for, or find useful.


  • I agree with everything you said, but (in Microsoft’s eyes) this is a feature - not a bug.

    Without this cloud component, how could:

    • Microsoft make sure that the accounting team does not introduce a malicious/old Python library into the Excel file?
    • Microsoft protect its users from writing/running inefficient, buggy, or malicious Python code?
    • Microsoft provide a Python runtime to users who do not know how to install Python?
    • Microsoft charge to run code that you wrote in a free, open source software programming language on a device that you own?

  • Over a year later and I still do not understand what the use case for this is.

    A lot of the examples/documentation that was made by Microsoft for this seems to focus on data analysis and data visualization. Anyone in those fields would probably prefer to get the data out of Excel and into their tool/pipeline of choice instead of running their Python code in Excel. That also makes the big assumption that the data being used is fully contained within the Excel file and that the libraries used within the code are avalaible in Excel (including the library version).

    For anyone looking to learn/use Excel better, I doubt the best use of their time is learning a new programming language and how Excel implements that programming language. They would likely be better off learning Excel’s formulas, pivot tables, charts, etc. They could even learn Power Query to take things to another level.

    For anyone looking to learn Python, this is absolutely a terrible way to do so. For example, it abstracts away library maintenance, could provide modified error messages, and makes the developer feedback loop more complicated.

    If you want to automate Excel then this realistically allows for very little new functionality that did not exist prior to this feature. Using other Python libraries like OpenPyxl and xlWings will still be required to automate Excel.

    I am sure there are edge cases where this iteration of Python in Excel is perfect. However, this feels like a checkbox filler (“yeah, Excel supports Python now”) than an implementation of an actual useful feature. A fully featured and supported Python library that manipulates Excel/Excel files would have been a much more exciting and useful feature - even if it had to be executed outside of Excel, like OpenPyxl.



  • I’m curious about this. The source text of your comment appears that your comment was just the URL with no markdown. For your comment about a markdown parsing bug to be true, shouldn’t the URL have been written in markdown with []() notation (or a space between the URL and the period) since a period is a valid URL character? For example, instead of typing https://google.github.io/styleguide/cppguide.html., should [https://google.github.io/styleguide/cppguide.html.](https://google.github.io/styleguide/cppguide.html) have been typed?





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


  • 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”?


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


  • I agree! I’m not sure why you’re being downvoted either.

    This new integration just allows you to do data analysis and data visualization of existing data within an Excel file via Python. The output of your Python scripts is limited to the Excel file. The Python environment itself is also limited as it runs on Microsoft’s platform and is controlled by Microsoft.

    The (Excel) problem that people already using Python for data analysis/visualization is that they have to use Excel files. Reading/writing Excel files via Python can sometimes be tedious or limiting. Utilizing Python inside of Excel via this integration may help in some scenarios, but they won’t be able to use custom libraries built internally, control the Python environment (eg - must use specific version of Python or Python library, can’t utilize all Python libraries available on pip, etc.), connect to all necessary external data sources via Python, and utilize proper VCS tools like git.

    The problem that people automating tasks via Python have is that there is no Python library nearly as capable of reading or manipulating Excel files as VBA is. This new Python integration does not change that.

    The problem that Excel users have is that they want more advanced (or simple/easier) data analysis and data visualization capabilities. However, with Excel’s dynamic array formulas, LAMBDA formula, Power Query, and Power Pivot, Excel is becoming much more capable than it ever was. If those tools cannot meet your needs, you likely need to move to something like R, Python, or some other tool. Embedding Python into Excel like this integration does still limits Python with all of Excel’s current restraints (size, performance, etc.).


  • I’m not a fan of it either, but I’m not sure how else this could work seamlessly. How would you ensure that everyone you share your Excel file that utilizes Python has the expected Python setup on their machine? What if they have an older version of a library you used that breaks your script? What if they don’t have Python installed at all?

    While this will only work on Windows desktop at first, Microsoft plans to roll this out to “other platforms” over time. Is there any other way for this integration to work for Excel for web, iPad, and/or Teams?



  • Will this actually automate your workflow?

    It seems that this Python integration expects that the source data already exists within the Excel file and Python can essentially just be used to create either visuals or new tables within the same Excel file.

    If that’s accurate, then this is intended exclusively for data analysis and not process automation. I don’t think this will allow people to enhance their existing Python based ETL jobs or create new ones because of this new integration. This does not seem to be a replacement/substitute for VBA or OfficeScripts. It also does not seem to be an alternative to Power Query. If anything, this seems to be most similar to Power Pivot.