New Python Integration in Microsoft Excel

This new Python integration will enable advanced visualisations, machine learning, predictive analytics and data cleansing.

Microsoft has announced new analytics capabilities in Excel by launching a Public Preview of Python in Excel. Thanks to this implementation, from now on, Python in Excel allows you to natively combine Python and Excel analytics in the same workbook, with no configuration required; you can write Python code directly in a cell; Python calculations are run in the Microsoft Cloud and the results are returned to the spreadsheet, including charts and visualisations.

Python differences in Microsoft Excel

1 – Designed for analysts

From today, Python in Excel will also be natively integrated directly into the Excel grid. To get started, simply use the new PY feature that allows you to enter Python code directly into Excel cells.

Excel users now have access to powerful analytics through Python for visualisations, data cleansing, machine learning, predictive analytics, and more. Users will be able to create end-to-end solutions that seamlessly combine Excel and Python, all within Excel.

Using the built-in Excel and Power Query connectors, users can easily bring external data into Python in Excel workflows. Python in Excel supports the tools that users already know and love, such as Excel formulas, pivot tables, and charts. Here are some examples of analysis types:

  • Advanced Visualisations: Leverage the power of popular Python charting libraries such as Matplotlib and seaborn to create a wide variety of charts, ranging from conventional bar charts and line charts to specialised visualisations such as heat maps, violin charts, and swarm charts.
  • Machine Learning, Predictive Analytics, and Forecasting: Leverage the capabilities of Python libraries such as scikit-learn and statsmodels to apply popular machine learning, predictive analytics, and forecasting techniques, such as regression analysis, time series modelling and more.
  • Data Cleaning: Use advanced data cleaning techniques, such as locating missing values, standardising formats, removing duplicates, and using techniques such as regular expressions for pattern-based transformations.

2. Python in Excel through Anaconda.

Anaconda is a leading repository of enterprise Python used by tens of millions of data professionals worldwide. Python in Excel leverages the Anaconda Distribution for Python running on Azure, which includes the most popular Python libraries (e.g. pandas, Matplotlib, scikit-learn, etc.) and is built, tested, and securely supported by Anaconda. Python provided by Anaconda supports a wide range of analysis with Python in Excel.

3. Python in Excel runs securely in the Microsoft Cloud.

The Python code used by Excel runs securely in the enterprise-level Microsoft Cloud as a Microsoft 365 compliant connected experience. The Python code runs in its own isolated container on hypervisor using Azure Container Instances and secure packages compiled from Anaconda via a secure software supply chain.

Python in Excel keeps your data private by preventing Python code from knowing who you are and by opening workbooks from the Internet in additional isolation within their own separate containers. Data from your workbooks can only be sent through the built-in Python xl() function, and the result of the Python code can only be returned as the result of the Excel =PY() function.

4. Designed for teams.

Users can share Python workbooks in Excel with confidence. Teammates can seamlessly interact and update Python-based analyses in Excel without having to worry about installing additional tools, Python runtime environments, or managing libraries and dependencies.

Users can share workbooks using their favourite collaboration tools, such as Microsoft Teams and Microsoft Outlook, and work together seamlessly through comments, mentions, and co-editing with colleagues, just as they would normally do in Excel. Sensitivity labels applied to your workbooks containing Python will keep them compliant with your organisation’s information protection policies.

5. Python in Excel reflects Microsoft’s deep commitment to Python.

Python in Excel was created through close collaboration between several teams at Microsoft, including Excel, Developer Division, Security, Azure, and Research. This project reflects the importance of Python to Microsoft and the commitment to collaborate with the Python community and to make Python better and more accessible to everyone.