Sign inGet started
← Back to all guides

How to use ChatGPT for data analytics

By Nick Barth

Updated on March 6, 2024

The era of AI-augmented data analytics is upon us, and as a data professional, integrating the ingenuity of AI models like ChatGPT into your workflow can dramatically improve efficiency and insights. This guide will walk you through the essential features of ChatGPT that can be leveraged for data analytics tasks. Whether you're a data scientist fine-tuning predictive models, a business analyst uncovering market trends, or an AI enthusiast exploring the potential of language models in analytics, these tools are game-changers.

ChatGPT features for data analytics

Code completion

Ever find yourself grappling with the right syntax or the most efficient function to use? ChatGPT acts as your virtual pair programmer, suggesting code completions and optimizing segments of your scripts. It supports a multitude of programming languages and frameworks prevalent in data analysis, such as Python, R, and others.

SQL code completion

For those of you who interact regularly with databases, ChatGPT’s ability to help you construct and debug SQL queries can significantly speed up your database operations. By providing code suggestions, it simplifies the management of data retrieval, which is fundamental to the subsequent analysis phase.

AI-driven chart creation

Visuals speak louder than numbers. ChatGPT can assist in generating scripts for compelling, data-driven charts. Through simple prompts, you can guide the AI to produce code for charts using libraries like Matplotlib, Seaborn, or Plotly in Python, thereby transforming raw data into striking visual narratives.

How ChatGPT connects with Deepnote for seamless analytics

For practitioners seeking a harmonious blend of notebook functionality and AI assistance, Deepnote is a platform that stands out. With its best-in-class AI for notebooks, Deepnote provides a collaborative environment where the analytical prowess of ChatGPT can be fully utilized.

Here's how you can harness the power of ChatGPT in a Deepnote notebook for your data analytics projects:

  1. Setting up your environment: Initialize your Deepnote project and ensure that all necessary packages and dependencies are installed. This includes the AI language models package (e.g., `openai` Python package) to interact with ChatGPT.
  2. Integrating ChatGPT: Utilize the Python package within your notebook to send prompts to ChatGPT. Ensure you have the appropriate API keys and permissions set up.
  3. Querying data: When dealing with databases, leverage ChatGPT's capabilities to write efficient SQL queries. Craft your prompts to include the table and data structure details, and allow the AI to formulate the query for you.
  4. Analyzing data: Input your data analysis goals into ChatGPT. For instance, if you're looking to perform a linear regression, provide the model specifications, and it can return the corresponding Python code, using libraries like `scikit-learn`.
  5. Visualizing results: With your analysis complete, prompt ChatGPT to suggest the code for visualizations that best represent your findings. Be specific in your requests – whether you're after a histogram, scatter plot, or heatmap – ChatGPT can help generate the script.
  6. Refining your work: Use ChatGPT to review and refine your code. It can suggest optimizations and highlight potential errors, thus acting as a first-pass reviewer for your analytical scripts.
  7. Collaborative features: As Deepnote specializes in collaborative workspaces, take advantage of ChatGPT to assist in explaining code blocks to team members, making project progression more efficient.
  8. Documentation: Create clear and comprehensive documentation by using ChatGPT to articulate the functionality of your code and the insights derived from your analysis.


In conclusion, ChatGPT offers a plethora of opportunities for data scientists, analysts, and AI enthusiasts. Its capacity for code completion, SQL assistance, and AI-powered chart plotting can streamline the data analytics process significantly. Coupled with Deepnote's interactive and collaborative notebook environment, you have a formidable toolkit at your command.

As you embark on your next data project, embrace these AI advancements. Let ChatGPT boost your analytics to new heights, combining your expertise with the efficiency of an intelligent language model. Happy analyzing!


Keep in mind that while ChatGPT can significantly aid in data analytics, it is crucial to maintain a thorough understanding of the underlying concepts and methodologies to ensure integrity and interpret AI-generated insights accurately.

Nick Barth

Product Engineer

Nick has been interested in data science ever since he recorded all his poops in spreadsheet, and found that on average, he pooped 1.41 times per day. When he isn't coding, or writing content, he spends his time enjoying various leisurely pursuits.

Follow Nick on LinkedIn and GitHub

That’s it, time to try Deepnote

Get started – it’s free
Book a demo



  • Integrations
  • Pricing
  • Documentation
  • Changelog
  • Security




  • Privacy
  • Terms

© Deepnote