E-commerce Sales Analysis in Python
Explore an e-commerce sales dataset with monthly trends, top products, category breakdowns, and average order value analysis.
What this AI workflow does
This AI Data Analyst workflow loads the Online Retail Excel dataset from a URL and summarizes its structure with shape, dtypes, and missing values. It generates exploratory visuals for monthly revenue trends and identifies the top 10 products by total revenue. It computes average order value and compares AOV across countries with a focused country-level breakdown.
Who this example is for
This is for analysts and data scientists who want a conversational, code-generating EDA template for e-commerce transaction data in Python. It helps users quickly validate data quality and produce standard sales KPIs and plots for reporting or further modeling.
Expected analysis outcomes
These are the results the AI workflow is expected to generate.
- Dataset shape, dtypes, and null counts
- Monthly revenue trend line chart
- Top 10 products by total revenue bar chart
- Average order value overall and by country
- Bar chart of top countries by AOV
Tools and libraries used
Main Python packages and tooling used to run this AI data analysis task.
- pandas
- numpy
- matplotlib
- seaborn
- openpyxl
Prompt sequence
This is the exact list of prompts used in this workflow. The same prompt sequence is sent to each model so outputs and scores can be compared fairly.
- 1load the retail sales dataset from https://raw.githubusercontent.com/pplonski/datasets-for-start/refs/heads/master/online-retail/Online-Retail.xlsx and show basic info and shape
- 2plot monthly revenue trend
- 3show top 10 products by total revenue
- 4what is the average order value and how does it vary by country?
Model Comparison
We compared several LLM models on the same analysis task. The table below shows their scores side by side. You can also open each model run to check the full conversation and notebook results.
| Model Source | Score | Task | Execution | Output | Reasoning | Reliability | Run |
|---|---|---|---|---|---|---|---|
| glm-5.1 | 10/10 | 2/2 | 2/2 | 3/3 | 2/2 | 1/1 | Open glm-5.1 conversation |
| gpt-5.4 | 10/10 | 2/2 | 2/2 | 3/3 | 2/2 | 1/1 | Open gpt-5.4 conversation |
| gpt-oss:120b | 10/10 | 2/2 | 2/2 | 3/3 | 2/2 | 1/1 | Open gpt-oss:120b conversation |
| qwen3.5:397b | 10/10 | 2/2 | 2/2 | 3/3 | 2/2 | 1/1 | Open qwen3.5:397b conversation |
| gemma4:31b | 9/10 | 2/2 | 2/2 | 3/3 | 1/2 | 1/1 | Open gemma4:31b conversation |
| qwen3-coder-next | 9/10 | 2/2 | 2/2 | 3/3 | 1/2 | 1/1 | Open qwen3-coder-next conversation |
How scoring works
Each run is graded on five dimensions:
- Task Completion (0-2): how fully the workflow answered the requested analysis task and completed required steps.
- Execution Correctness (0-2): whether generated code is correct, consistent, and likely runnable without major fixes.
- Output Quality (0-3): how well tables, charts, and results match the expected analytical outcomes.
- Reasoning Quality (0-2): clarity and correctness of interpretation, explanation, and conclusions.
- Reliability (0-1): robustness of the run, including low hallucination risk and stable behavior.
The final score is the sum of these dimensions, so total score = 0-10. Higher values indicate more complete, correct, and reliable notebook results for this workflow.
AI Analysis with qwen3.5:397b
This run uses AI with a step-by-step list of prompts to perform the analysis task E-commerce Sales Analysis in Python. Below, you can review the full conversation generated with qwen3.5:397b. After the conversation, we show detailed score cards for this run.
Score cards for qwen3.5:397b for E-commerce Sales Analysis in Python
Total score: 10/10
Task Completion: 2/2
ExcellentAll four requested analysis steps were attempted and the notebook includes outputs for dataset info, monthly revenue, top products, and AOV by country.
Execution Correctness: 2/2
ExcellentThe provided code is coherent and likely runnable: it loads the dataset, computes revenue, aggregates by month/product/country, and produces the requested outputs.
Output Quality: 3/3
ExcellentThe outputs match the expected outcomes semantically: shape/dtypes/nulls are shown, a monthly revenue line chart is produced, top 10 products are listed, and AOV by country is computed with country breakdown.
Reasoning Quality: 2/2
ExcellentThe workflow uses appropriate EDA logic and correctly explains the steps for each analysis task. The reasoning is clear and aligned with the requested questions.
Reliability: 1/1
ExcellentThe workflow is reasonably robust and consistent, with no obvious hallucinated functions or contradictory logic in the provided content.
Try MLJAR Studio
Run the same type of AI-powered data analysis on your own datasets with conversational notebooks in MLJAR Studio.
Explore More AI Analysis Examples
Discover additional workflows across categories. Each example includes prompts, conversation outputs, and model-level scoring so you can compare approaches and results.