From CSV to Complete Analytical Report with ChatGPT in 5 Simple Steps – KDnuggets
Data analysis is a time-consuming activity. With ChatGPT, we can perform data summary, data preprocessing, data visualization, and many others in a short time.

Image by rawpixel.com on Freepik
No matter what business you are in, knowing how to analyze data is more important than ever in the data-driven era. Data analysis would enable businesses to stay competitive and provide the ability to make better decisions.
The importance of data analysis drives every individual to know how to perform data analysis. However, sometimes it takes too much time to conduct data analysis. That’s why we could rely on ChatGPT to create a complete report from our data file.
This article will explore five simple steps to create complete analytical reports from your CSV file. These five steps include:
Step 1: Importing the CSV File
Step 2: Data Summary and Preprocessing
Step 3: Data Analysis
Step 4: Data Visualization
Step 5: Report Generation
As a prerequisite, this article assumes that the reader has subscribed to ChatGPT Plus. With that in mind, let’s get started.
The first step is to prepare the CSV file that you want to analyze and create a report. This file could come from any trustworthy source, but this article would use the Telecom Churn dataset from Kaggle.
Ensure the data is structured, organized, and has a clear header. If you have a certain target that you want to analyze, then don’t forget to include that data in the file. In our example, we would try to perform an analysis for the churn column.
With the data ready, attach them to the ChatGPT and let the model do their work.
The next step is to get the data summary from our CSV file and preprocess them. Input the following prompt while you upload the data.
The above prompt provides the following results:
Here’s the summary of your dataset:
Number of Rows: 3333
Number of Columns: 11
Column Names:
Churn
AccountWeeks
ContractRenewal
DataPlan
DataUsage
CustServCalls
DayMins
DayCalls
MonthlyCharge
OverageFee
RoamMins
Data Types:
Integer: Churn, AccountWeeks, ContractRenewal, DataPlan, CustServCalls, DayCalls
Float: DataUsage, DayMins, MonthlyCharge, OverageFee, RoamMins
Missing Values: There are no missing values in any of the columns.
ChatGPT clearly could read the data well and was able to provide the given dataset. The next result is the data preprocessing from the ChatGPT.
Since there are no missing values in the dataset, the main focus of data cleaning and preprocessing will be on:
Let’s proceed with these steps.

The boxplots provide a visual overview of potential outliers in each numerical column of your dataset. Here are some observations:
Given this information, the next steps in data cleaning and preprocessing could include:
You can let the ChatGPT perform additional steps for the data cleaning and preprocessing or let it be as it is. For this example, we would continue to the next steps.
Next, we would perform data analysis with ChatGPT. The data analysis is depending on what you want to achieve. In our case, we want to perform data analysis from the Churn POV.
We use the following prompt to execute the data analysis with ChatGPT for the above case.
The data analysis can be seen in the following result.
To perform data analysis with respect to the churn data, we’ll focus on understanding how different factors relate to customer churn. Churn, being a binary variable (0 for no churn, 1 for churn), is typically analyzed through classification methods and by examining relationships with other variables. Here’s the plan:
Let’s start with the correlation analysis and then move on to the next steps.
Correlation Analysis with Churn
The correlation of different variables with churn is as follows (from strongest negative to strongest positive correlation):
Negative Correlation:
Positive Correlation:
Based on these correlations, it seems that factors like contract renewal, customer service calls, daily minutes, and overage fees are more closely related to churn. We can further explore these factors through visual analysis and statistical tests, especially for categorical variables like ContractRenewal and DataPlan.
Visual Analysis

The visualizations offer valuable insights into the relationship between different variables and churn:
Churn by ContractRenewal and DataPlan:
Numerical Variables (CustServCalls, DayMins, MonthlyCharge, OverageFee) by Churn:
Conclusions from the Analysis
Next Steps
Based on these insights, targeted strategies can be developed to reduce churn, such as improving customer service, revising pricing strategies, or offering incentives for contract renewal and data plan subscriptions.
With a single prompt, we can see how well ChatGPT could give us the complete data analysis and come up with insight from the data. You can tweak the analysis aims and start from there.
The data visualization is a supportive activity to improve the data analysis and overall report. By having the visualization, we can have a more comprehensive report to understand our data.
Using the following prompt, we can perform the data visualization with ChatGPT.
To enhance the understanding of the data analysis results, I’ll create a series of visualizations that clearly depict the key findings related to customer churn. These visualizations will include:
To visualize the correlation of all variables with churn.

The visualization would show all the important plots that encapsulate the whole dataset. We can ask for more detailed descriptions for each plot, which you can try independently.
The last step is to generate the report based on the previous steps. Unfortunately, ChatGPT might not capture all the description and insight from the data analysis, but we can still have the simple version of the report.
Use the following prompt to generate a PDF report based on the previous analysis.
You will get the PDF link result with your previous analysis covered. Try to iterate the steps if you feel the result is inadequate or if there are things you want to change.
Data analysis is an activity that everyone should know as it’s one of the most required skills in the current era. However, learning about performing data analysis could take a long time. With ChatGPT, we can minimize all that activity time.
In this article, we have discussed how to generate a complete analytical report from CSV files in 5 steps. ChatGPT provides users with end-to-end data analysis activity, from importing the file to producing the report.
Cornellius Yudha Wijaya is a data science assistant manager and data writer. While working full-time at Allianz Indonesia, he loves to share Python and Data tips via social media and writing media.
By subscribing you accept KDnuggets Privacy Policy
Get the FREE ebook ‘The Great Big Natural Language Processing Primer’ and ‘The Complete Collection of Data Science Cheat Sheets’ along with the leading newsletter on Data Science, Machine Learning, AI & Analytics straight to your inbox.
By subscribing you accept KDnuggets Privacy Policy
Subscribe To Our Newsletter
(Get The Complete Collection of Data Science Cheat Sheets & Great Big NLP Primer ebook)
Get the FREE ebook ‘The Great Big Natural Language Processing Primer’ and ‘The Complete Collection of Data Science Cheat Sheets’ along with the leading newsletter on Data Science, Machine Learning, AI & Analytics straight to your inbox.
By subscribing you accept KDnuggets Privacy Policy
Get the FREE ebook ‘The Great Big Natural Language Processing Primer’ and ‘The Complete Collection of Data Science Cheat Sheets’ along with the leading newsletter on Data Science, Machine Learning, AI & Analytics straight to your inbox.
By subscribing you accept KDnuggets Privacy Policy