Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon

Getting Started with ChatGPT Advanced Data Analysis- Part 1

Save for later
  • 10 min read
  • 08 Nov 2023

article-image

Dive deeper into the world of AI innovation and stay ahead of the AI curve! Subscribe to our AI_Distilled newsletter for the latest insights. Don't miss out – sign up today!

Introduction

Imagine having a spreadsheet containing the certification exam scores of various members of the organization. In the past, we had to spend some time writing code that generates charts from existing comma-separated values (CSV) files and Excel spreadsheets. Instead of writing code, we could also generate charts directly in Google Spreadsheets or Microsoft Excel. We might even be tempted to utilize business intelligence tools for this type of requirement. Now, it is possible to generate charts immediately using the right set of prompts with ChatGPT Advanced Data Analysis!

In this two-part post, we will showcase a few examples of what we can do using the ChatGPT Advanced Data Analysis feature. You would be surprised how powerful this capability is for solving various types of requirements and tasks. While the general audience might think of ChatGPT as being limited only to text-based conversations, its advanced data analysis capabilities go beyond just textual interactions. With its ability to understand and process various types of datasets and files, it can produce useful visualizations and perform data analysis and data transformation tasks.

To demonstrate what we can do with this feature, we’ll have the following sections in this post:

Example 01 — Generating a CSV file

Example 02 — Analyzing an uploaded CSV file, transforming the data, and generating charts

Example 03 — Processing and analyzing an iPython notebook file (discussed in Part 2)

Example 04 — Processing and analyzing the contents of a ZIP file (discussed in Part 2)

Current Limitations  (discussed in Part 2)

Whether you're a student working on a project or an analyst trying to save time on manual data analysis and processing tasks, ChatGPT's Advanced Data Analysis feature can be a game-changer for your data processing needs. That said, let's dive into some of its powerful features and see what we can accomplish using this amazing feature!

Example 01: Generating a CSV file

In this first example, we will (1) enable Advanced data analysis, (2) generate a comma separated values (CSV) file containing random values, and (3) download the CSV file to our local machine. We will use this generated CSV file in the succeeding examples and steps.

STEP # 01: Let’s start by signing in to your ChatGPT account. Open a new web browser tab and navigate to https://chat.openai.com/auth/login.

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-0

Image 01 — Signing in to your OpenAI account

Click Log in and sign in using your registered email address and password. If you don’t have an account yet, make sure to sign up first. Since we will be using the Advanced Data Analysis feature, we need to upgrade our plan to ChatGPT Plus so that we have access to GPT-4 along with other features only available to ChatGPT Plus users.

STEP # 02: Make sure that Advanced data analysis is enabled before proceeding.

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-1

Image 02 — Enabling the Advanced data analysis feature

STEP # 03: Create a new chat session by clicking + New Chat. Make sure to select Advanced Data Analysis under the list of options available under GPT-4:

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-2

Image 03 — Using Advanced Data Analysis

STEP # 04: In the chat box with the placeholder text “Send a message”, enter the following prompt to generate a CSV file containing 4 columns with randomly generated values:

Generate a downloadable CSV spreadsheet file with 4 columns:

- UUID
- Name
- Team
- Score

Perform the following:

- For the UUID column, generate random UUID values
- For the Name column, generate random full names
- For the Team column, make sure to select only from the following teams: Technology, Business Development, Operations, Human Resources
- For the Score column, generate random whole numbers between 1 to 10
- Have a total of 20 rows

After a few seconds, ChatGPT will give us a response similar to what we have in Image 04.

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-3

Image 04 — ChatGPT generating a CSV file

Here, we can see that ChatGPT was able to successfully generate a CSV file. Awesome, right?

STEP # 05: Click download it here to download the generated CSV file to your local machine. Feel free to inspect the downloaded file and verify if the instructions were implemented correctly. Make sure to always verify the results and files produced by ChatGPT as you might find discrepancies or errors.

STEP # 06: Now, click Show work.

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-4

Image 05 — Code used to generate the CSV file

This should display the code or script used to perform the operations instructed by the user. You should be able to copy the code, modify it, and run it separately in your local machine or a cloud server.

Wasn’t that easy? Now, let’s proceed to our second example.

Example 02: Analyzing an uploaded CSV file, transforming the data, and generating charts

In this second example, we will upload the generated CSV file from the previous example and perform various types of data transformations and analysis.

STEP # 01: Create a new chat session by clicking + New Chat. Make sure to select Advanced Data Analysis under the list of options available under GPT-4:

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-5

Image 06 — Creating a new chat session using Advanced Data Analysis

STEP # 02: Click the + button and upload the downloaded file from the earlier example. In addition to this, enter the following prompt:

Analyze the uploaded CSV file and perform the following:

- Group the records by Team
- Sort the records from highest to lowest (per team)

Display the table and generate a downloadable CSV file containing the final output

This should yield a response similar to what we have in the following image:

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-6

Image 07 — Using ChatGPT to analyze the uploaded CSV file

Given that the data is randomly generated, you will get a different set of results. What’s important is that there are 4 columns: UUID (Universal Unique Identifier), Name, Team, and Score in the generated CSV file and in what is displayed in the table.

STEP # 03: Click the Show work button:

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-7

Image 08 — Code used to read and process the uploaded CSV file

Here, we can see that ChatGPT used Pandas DataFrames to process the data behind the scenes.

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at €18.99/month. Cancel anytime

STEP # 04: Locate and click the download the grouped and sorted CSV file here button. Feel free to inspect the downloaded file. Make sure to always verify the results and files produced by ChatGPT as you might find discrepancies or errors.

STEP # 05: Next, enter the following prompt to generate a bar chart to compare the average scores per team:

Generate a bar chart to compare the average scores per team

This should yield the following response:

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-8

Image 09 — Generating a bar chart

Cool, right? Here, we were able to generate a bar chart in ChatGPT. Imagine the different variations, scenarios, and possibilities of what we can do with this feature! Now, let’s check what’s happening behind the scenes in the next step.

STEP # 06: Click Show work

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-9

Image 10 — Code used to generate a bar chart

This should display a block of code similar to what is shown in Image 10. Here, we can see that matplotlib was used to generate the bar chart in the previous step. If you have not used matplotlib before, it’s a popular library for creating static and interactive visualizations in Python. Instead of coding this ourselves, all we need now is the right prompt!

STEP # 07: Now, let’s run the following prompt to compare the maximum scores achieved by the members of each team:

Generate a bar chart to compare the max scores per team

This should yield the following response:

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-10

Image 11 — Generating a bar chart to compare the max scores per team

Here, we see a bar chart comparing the maximum score achieved by the members of each team. Given that the data used was randomly generated in an earlier step, you might get a slightly different chart with different maximum score values per team. Make sure to always verify the results and files produced by ChatGPT as you might find discrepancies or errors.

 

STEP # 08: Enter the following prompt to group the records per team and generate a CSV file for each team:

Divide the original uploaded CSV file and generate separate downloadable CSV files grouped per team

After a few seconds, ChatGPT will give us the following response:

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-11

Image 12 — Dividing the original uploaded CSV file and generating multiple CSV files per team

Feel free to download the CSV files generated to your local machine.

STEP # 09: Click Show work

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-12

Image 13 — Code used to generate CSV files per team

STEP # 10: Use the following prompt to generate a ZIP file containing the CSV files from the previous step:

Generate a downloadable ZIP file containing the CSV files generated in the previous answer

ChatGPT should give us the following response:

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-13

Image 14 — Generating a downloadable ZIP file

Here, we should be able to download the ZIP file to our local machine/laptop. Feel to verify if the CSV files are inside the ZIP file by extracting the contents and reviewing each file extracted.

STEP # 11: Run the following prompt to convert the CSV files to XLSX (which is a well-known format for Microsoft Excel documents):

Convert each file inside the ZIP file to XLSX and generate a new ZIP containing the XLSX files

ChatGPT should give us the following response:

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-14

Image 15 — ChatGPT generating a ZIP file for us

Amazing, right? While we’ve been using CSV files in our examples, it does not mean that we’re limited to these types of files only. Here, we can see that we can work with XLSX files as well.

STEP # 12: Download the ZIP file and open it on your local machine/laptop.

STEP # 13: Run the following prompt to generate a ZIP file with all the charts generated in the current chat thread:

Generate a ZIP file containing all the charts and images generated in this chat thread

This should yield the following response:

getting-started-with-chatgpt-advanced-data-analysis-part-1-img-15

Image 16 — Generating a ZIP file containing all the charts and images generated in the chat thread

Amazing, right? Now, all we need to do is download the ZIP file using the link provided by ChatGPT.

STEP # 14: Download the ZIP file and open it on your local machine/laptop. Make sure to always verify the results and files produced by ChatGPT as you might find discrepancies or errors.

Conclusion

That wraps up the first part of this post. At this point, you should have a good idea of what you can accomplish using ChatGPT Advanced Data Analysis. However, there’s more in store for us in the second part as we’ll build on top of what we learned already and work on more complex examples and scenarios!

If you’re looking for the link to the second part, here it is: Getting Started with ChatGPT Advanced Data Analysis- Part 2.

Author Bio

Joshua Arvin Lat is the Chief Technology Officer (CTO) of NuWorks Interactive Labs, Inc. He previously served as the CTO of 3 Australian-owned companies and also served as the Director for Software Development and Engineering for multiple e-commerce startups in the past. Years ago, he and his team won 1st place in a global cybersecurity competition with their published research paper. He is also an AWS Machine Learning Hero and he has been sharing his knowledge in several international conferences to discuss practical strategies on machine learning, engineering, security, and management. He is also the author of the books "Machine Learning with Amazon SageMaker Cookbook", "Machine Learning Engineering on AWS", and "Building and Automating Penetration Testing Labs in the Cloud". Due to his proven track record in leading digital transformation within organizations, he has been recognized as one of the prestigious Orange Boomerang: Digital Leader of the Year 2023 award winners.