No More Manual Data Exploration
With recent advancements in AI, the landscape of data science is rapidly evolving. Google has finally integrated the powerful Gemini AI data science agent into Google Colab. Gone are the days of painstakingly importing packages, building every data analysis block from scratch. Now, you can simply state your analytical needs in natural language, and Gemini, seamlessly embedded within Colab, will generate an execution plan and the necessary code to kickstart your analysis. This breakthrough empowers you to focus on extracting meaningful insights rather than wrestling with syntax.
Furthermore, Colab’s intuitive interface allows you to insert code cells generated by Gemini’s pane directly into your notebook effortlessly. You can even generate code cells by writing prompts directly within the notebook itself.
Experience the speed and efficiency of AI-driven data analysis and unlock insights faster than ever before.
Data Science Agent in Gemini AI
Google’s innovative Data Science Agent, now seamlessly integrated with Gemini AI, is revolutionizing data analysis. Its core purpose is to simplify your workflow. Simply provide a data file and describe your analytical goals in natural language. The Agent handles the rest, delivering results with remarkable efficiency. Fully integrated into Google Colab, it enables us to:
- Generate an execution plan: From data loading and exploration to visualization, the Agent outlines the necessary steps based on your prompt.
- Write and execute code for each stage: It intelligently generates and runs the code, providing analysis at every step.
- Execute the entire analytical pipeline: Effortlessly run the complete plan with a single command.
- Generate a summary and answer your query: Receive clear, actionable insights directly from the analysis.
To illustrate the power of this tool, let’s explore a simple dataset and demonstrate how to leverage the Data Science Agent within Google Colab.
Data analysis made simpler with Colab
For this example, we are using the Chocolate sales dataset. Download the dataset and follow the tutorial below.
Using DS Agent Integrated With Gemini AI
Step – 1: Create a new notebook in Google Colab
Step – 2: Either click “Analyze files with Gemini”, available below the first cell or open the Gemini AI window from the top right corner, as shown in the image below.

Step – 3: Upload the data file and write the prompt
Prompt:
Given chocolate sales data help me in understand and analyse the data.
1. What are the columns available?
2. What are each columns distribution and any missing data?
3. If thereโs any missing data fill it with appropriate methods suitable for that column
4. Are there any relations between columns based on bivariate analysis?
5. Add a derived feature chocolate type such as dark, milk e.t.c based on name
6. I want to forecast sales of the chocolates, so I need to understand if thereโs any trend or seasonality for types of chocolates.
7. Give me next steps to build predictive model for chocolate sales.

Step – 4: Gemini provides you with an execution plan(A series of steps to accomplish the given task)
Step – 5: If you need any changes in the plan, you can fine-tune your plan by changing the prompt. Once you are satisfied, click on the “Execute plan” button. Gemini immediately starts executing your plan, and you can watch the code cells being created in the notebook and track the progress in the Gemini window.
Step – 6: Gemini executes the plan and provides a summary, where it puts its observations and answers to the question asked in the prompt.

Hurray! We have our data analysis ready. What used to take at least 30 minutes to perform with the help of Gemini we reduced it to 5 minutes. This is the easiest and fastest way to perform data analysis.
Further Analysis of The Data
Of course, we have got the head start from the Gemini, but it may not be perfect, and we may not have all the details we need. If you observe, Gemini even generates the code in different cells, as we do in a notebook development environment, so it is easier to adjust any part of the code.
So, we have to take on further analysis from this point. However, Gemini AI is still with us, we can use it in a couple more ways to make the coding process easier.
Gemini AI Window
We have the Gemini AI available in a window, which can be opened from the top right corner. You can continue the chat and ask more prompts, but it won’t automatically generate the code and execute it. But we have the functionality to insert code cells from Gemini to Notebook wherever we want them.

In the above image, I have got a response for the additional query as a code cell. We can insert it directly or copy and paste it wherever necessary. So, we can truly complete the data analysis using entirely natural language.
Use The Generate Cell
We know that a typical notebook has two types of cells, Code and Text. In Google Colab, when you create a new cell, it has a generate option available to it. Using this, we can provide an in-line prompt and get it converted to a code cell.

This is the most convenient and easiest way I have found till date, to leverage AI for coding. Write a prompt, get the code, and execute it, entirely in one place.
Well, we have covered all the ways we can leverage Gemini AI to make the data analysis as smooth as possible. To look at the entire notebook, refer to our Github Repo or Google Colab.
If Gemini AI is not generating the code required by you, then you should try out Github Copilot, AI designed to code.
Conclusion
Reading a data file, looking at the available columns, missing statistics, checking data distribution is a repetitive and mundane tasks. We should not waste our time in doing them, instead, we should leverage AI and use the time effectively and focus our energy on the actual data analysis and reporting rather than creating skeleton code.
Be smart and work smart with Gemini AI.