(Originally published on August 28, 2023 by Ndeyanta Jallow)
Hello, Microsoft 365 Insiders! My name is Ndeyanta Jallow and I’m a Product Manager on the Excel team. I am excited to share with you the availability of the Public Preview of Python in Excel – which makes it possible to integrate Python and Excel analytics within the same Excel grid for uninterrupted workflow.
IMPORTANT: Python in Excel is now available to all Enterprise, Business, Education, and Family and Personal users running Beta Channel on Windows. This feature will roll out to Excel for Windows first, starting with Version 2309 (Build 16818.20000), and then to other platforms at a later date. Sign up to be notified about future availability for Python in Excel.
(6/10/24) UPDATE: Python in Excel is gradually rolling out to Enterprise, Business, Education, and Family and Personal users running Current Channel (Preview) builds on Windows. This feature is rolling out to Excel for Windows, starting with Version 2406 (Build 17726.20016).
Excel is an essential tool to organize, manipulate and analyze all kinds of data, while Python is one of the most popular programming languages today, loved by businesses and students alike - used for data analysis, visualization, machine learning and more.
We are excited to introduce the Public Preview of Python in Excel – combining Python's powerful libraries with Excel's features you know and love. We hope you explore the possibilities to analyze data in Excel using Python while leveraging Excel's formulas, conditional formatting and PivotTables to further refine your insights. For more details, look at our announcement blog. No set up or installation is required.
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, stats models for advanced statistical modeling, and Matplotlib and seaborn for data visualization. To learn more, see Open-source libraries and Python in Excel.
Give it a try and let us know what you think!
You can also enable the Python in Excel preview by entering =PY into an Excel cell and then choosing PY from the function AutoComplete menu. Selecting the PY function will trigger a dialog that allows you to enable the preview.
NOTE: Python in Excel uses the custom Python function xl() to interface between Excel and Python. The xl() function accepts Excel objects like ranges, tables, queries, and names. To reference Excel objects in a Python cell, make sure the Python cell is in Edit mode, and then select the cell or range that you want to include in the Python formula.
Python code used by Excel runs on the Microsoft Cloud with enterprise-level security as a compliant Microsoft 365 connected experience. The Python code runs in its own hypervisor isolated container using Azure Container Instances and secure, source-built packages from Anaconda through a secure software supply chain. Python in Excel keeps your data private by preventing the Python code from knowing who you are, and opening workbooks from the internet in further isolation within their own separate containers. Data from your workbooks can only be sent via the built-in xl() Python function, and the output of the Python code can only be returned as the result of the =PY() Excel function.
You can directly type formulas into a Python cell that references cells with the xl() function. For example:
See how this scenario works as we reference data in the Excel grid to create a DataFrame below.
In addition to creating DataFrames, we can also use Python functions to understand datasets, model and predict data and even create Python plots. To see this in action, take a look at the analysis done with the Iris dataset: Python in Excel - Dive into Data
Python in Excel is now available to all Enterprise, Business, Education, and Family and Personal users running Beta Channel on Windows. This feature will roll out to Excel for Windows first, starting with build Version 2309 (Build 16818.20000), and then to the other platforms at a later date.
(6/10/24) UPDATE: Python in Excel is gradually rolling out to Enterprise, Business, Education, and Family and Personal users running Current Channel (Preview) builds on Windows, starting with Version 2406 (Build 17726.20016).
The feature is not available in Excel for Mac, Excel on the web, Excel for iOS, or Excel for Android. On unsupported platforms, workbooks containing Python can be viewed but Python cells display an error.
Sign up to be notified about future availability for Python in Excel.
IMPORTANT: 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. More details will be available before General Availability.
As you use Python in Excel, please share your feedback and help us prioritize our work by clicking Help > Feedback and letting us know what you think.
Learn about the Microsoft 365 Insider program and sign up for the Microsoft 365 Insider newsletter to get the latest information about Insider features in your inbox once a month!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.