This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Important
This feature is inpreview.
Copilot for Data Science and Data Engineering is an AI assistant that helps analyze and visualize data. It works with Lakehouse tables and files, Power BI Datasets, and pandas/spark/fabric dataframes to provide answers and code snippets directly in a notebook. Connections to OneLake and default attached Lakehouses allow Copilot to provide contextualized code suggestions and natural language responses tailored to your data.
Copilot can help you understand your data better and offer suggestions to begin your notebook, including generating code for the initial cells. After identifying and adding data sources through the Fabric object explorer, Copilot Chat suggests model types to implement. You can copy these recommendations directly into your notebook to start development. If you're unsure of your next steps, you can invoke Copilot in-cell for model direction insights.
When you encounter errors, Copilot provides suggested fixes. For further help, you can chat with Copilot for more options, avoiding constant online searches.
You also benefit from automatic documentation with a simple "Add Comments" feature that summarizes code and data changes. This makes cells clear for you and others. Throughout your workflow, you can consult Copilot at specific points, receiving real-time support and guidance to accelerate your development process.
Note
With Spark 3.4 and later versions in Microsoft Fabric, no installation cell is required to use Copilot in your notebook. Previous versions that required an installation cell (Spark 3.3 and earlier) are no longer supported.
Note
With Copilot for Data Science and Data Engineering, you can chat with an AI assistant to handle your data analysis and visualization tasks. You can ask Copilot questions about lakehouse tables, Power BI Datasets, or Pandas/Spark dataframes inside notebooks. Copilot answers in natural language or code snippets. Copilot can also generate data-specific code for you, depending on the task. For example, Copilot for Data Science and Data Engineering can generate code for:
First, select the Copilot icon in the notebooks ribbon. The Copilot chat panel opens, and a new cell appears at the top of your notebook. You might also select Copilot at the top of your Fabric Notebooks cell.
To maximize Copilot's effectiveness, load a table or dataset as a dataframe in your notebook. The AI can then access the data and understand its structure and content. Next, start chatting with the AI. Select the chat icon in the notebook toolbar, and type your question or request in the chat panel. For example, you can ask:
Copilot responds with the answer or the code, which you can copy and paste into your notebook. Copilot for Data Science and Data Engineering is a convenient, interactive way to explore and analyze your data.
To chat with your data and get insights, select the chat icon in the notebook toolbar to open the Copilot chat panel. Type your questions or requests in the chat panel. For example, you can ask:
Copilot responds with the answer or the code, which you can copy and paste into your notebook. Additionally, Copilot can suggest what to do next with your data. Copilot provides suggestions and generates relevant code snippets to help you proceed with your data analysis and visualization tasks.
To interact with the Copilot chat panel in Microsoft Fabric notebooks, follow these steps:
Open the Copilot Chat Panel: Select the chat icon in the notebook toolbar.
Ask Questions or Make Requests: Type your questions or requests in the chat panel. Here are some specific examples for data science and data engineering:
Data Exploration:
Data Cleaning:
Data Transformation:
Visualization:
Machine Learning:
Model Evaluation:
Receive Responses: Copilot responds with natural language explanations or code snippets. You can copy and paste the code into your notebook to execute it.
Get Suggestions: If you don't know how to proceed, ask Copilot for suggestions:
With these steps and the provided examples, you can effectively interact with the Copilot chat panel to enhance your data science and data engineering workflows in Microsoft Fabric notebooks.
You can interact with Copilot directly within your notebook cells to generate code and perform quick actions on your code cells. Here's how to use the Copilot in-cell panel:
Can you generate code for a logistic regression that fits this data?Copilot provides the necessary code snippet directly in the cell below.
Fix Code: You can ask Copilot to fix errors in your code. Type your request in the text panel above the code cell, and Copilot suggests corrections.
Add Comments: To automatically document your code, use the "Add Comments" feature. Copilot generates comments that summarize the code and data changes, making your notebook more readable.
Optimize Code: For performance improvements, you can ask Copilot to optimize your code. Copilot provides suggestions to enhance the efficiency of your code.
Explain Code: If you need clarification about a piece of code, ask Copilot for an explanation. Copilot provides a detailed explanation of the code's functionality.
Invoke Copilot In-Cell: Select the Copilot icon in the notebook toolbar to start interacting with Copilot.
Type Your Request: Enter your request or question in the text panel above the code cell. For example:
Explain the following code snippet.Receive Suggestions: Copilot responds with the relevant code, fixes, comments, optimizations, or explanations.
Apply Suggestions: Copy the generated code or suggestions from Copilot and paste them into your notebook cells to execute them.
With the Copilot in-cell panel, you can generate code, fix errors, add comments, optimize performance, and understand your code better, all within your Microsoft Fabric notebooks.
Copilot for Data Science and Data Engineering also has schema and metadata awareness of lakehouse tables. Copilot can provide relevant information in the context of your data hosted in an attached lakehouse. For example, you can ask:
Copilot responds with the relevant information if you added the lakehouse to the notebook. Copilot also has awareness of the names of files added to any lakehouse attached to the notebook. You can refer to those files by name in your chat. For example, if you have a file namedsales.csv in your lakehouse, you can ask Copilot to "Create a dataframe from sales.csv". Copilot generates the code and displays it in the chat panel. With Copilot for notebooks, you can easily access and query your data from different sources. You don't need the exact command syntax to do it.
Copilot inline code completion is an AI-powered feature that helps you to write code faster and more efficiently in Fabric Notebooks. This feature provides intelligent, context-aware code suggestions as you type code. To learn more see,Copilot inline code completion
Copilot features in the Data Science experience are currently scoped to notebooks. These features include the Copilot chat pane, IPython magic commands that can be used within a code cell, and automatic code suggestions as you type in a code cell. Copilot can also read Power BI semantic models using an integration of semantic link.
If your tenant is configured with private link, the Copilot chat (sidecar chat) experience will not function. Copilot’s inline code suggestions and quick actions may still work, but chat interactions will fail to load.
Copilot has two key intended uses:
Code generation with fast-moving or recently released libraries might include inaccuracies or fabrications.
Copilot in notebooks provides users with two essential commands to manage chat history within notebook cells:show_chat_history andclear_chat_history. Theshow_chat_history command exports the complete chat history for compliance purposes, to ensure that all necessary interactions are documented and accessible for review. For example, executingshow_chat_history generates a comprehensive log of the chat history, which can then be reviewed or archived for compliance.
Theclear_chat_history command removes all previous conversations from the notebook, so that the user can start fresh. This command clears out old interactions, to start a new conversation thread. For instance, executingclear_chat_history deletes all previous chat history, to leave the notebook free of any past conversations. These features enhance the overall functionality and user experience of Copilot in notebooks.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?