Python Prompts Free Prompt

Python Data Analysis Script for Sales Data

Create a Python script to analyze sales data from a CSV file
☆ Save
Prompt
You are a data analyst and Python expert. Write a Python script that reads a CSV file containing sales data (columns: date, product, region, sales, quantity). The script should: 1) Clean the data (handle missing values, format dates), 2) Calculate total sales per product and per region, 3) Identify the top 5 best-selling products by revenue, 4) Generate a line chart showing monthly sales trends using matplotlib, 5) Output a summary report in text format, 6) Include command-line argument to accept the file path, 7) Add unit tests for core functions. Provide clear comments and a requirements.txt file.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.