# Python Sales EDA and Profitability Analysis

> Clean and analyze sales data in Python: KPIs, discount and margin analysis, RFM customer segments, and an interactive Plotly dashboard.

Python Sales EDA and Profitability Analysis is a free AI agent skill on Agensi by AMIN REDA, in Research & Analysis. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [AMIN REDA](https://www.agensi.io/creators/amin-reda)
- Category: [Research & Analysis](https://www.agensi.io/skills/research-analysis)
- Version: 1.0
- Last updated: 2026-11-19
- Security: scan passed (2026-11-19); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/python-sales-eda-and-profitability-analysis
- Tags: data-analysis, python, analytics

## About this skill

A repeatable workflow for taking a raw orders dataset to findings the business can act on.

1. **Load and inspect.** `shape`, `dtypes`, `head`, `isna().sum()`, duplicate count, and value counts for categorical columns. Note encoding problems when reading CSV (try `utf-8`, then `latin-1`).
2. **Clean.**
   - Parse dates explicitly; if formats are mixed, parse each format separately and report how many rows each covered. Do not silently coerce to NaT.
   - Validate logic: ship date must not precede order date; quantities positive; discount between 0 and 1.
   - Handle missing values deliberately (drop, fill, or flag) and say which rule was used and why.
   - Remove exact duplicates; investigate near-duplicates before dropping.
3. **Engineer features.** Processing/shipping time, order month and year, profit margin (`profit / sales`), discount buckets (for example 0, 0-10%, 10-20%, 20-30%, 30%+), customer order counts.
4. **KPIs.** Choose about 5 to 7: total sales, total profit, overall margin, average order value, orders count, average processing time, return or loss-making order share. Define each KPI in one line.
5. **Profitability analysis.**
   - Margin by region, category, sub-category, segment.
   - Profit versus discount bucket: share of loss-making orders and total loss per bucket. Report the threshold where losses dominate, as an observation from this dataset, not a universal rule.
   - Identify the biggest loss-making product groups.
6. **RFM segmentation.** Recency (days since last order versus a reference date), Frequency (orders), Monetary (sales or profit). Score each 1 to 5 by quantiles, combine into segments such as Champions, Loyal, At Risk, Lost. Show segment sizes and revenue share.
7. **Visualize.** Clear titles and axis labels, sorted bars, no 3D or pie overload. Use Seaborn or Matplotlib for static charts. For an interactive dashboard produce a single HTML file with Plotly (filters by year and region, KPI cards, key charts).
8. **Write findings.** 5 to 8 bullets: what is true in the data, how big the effect is, and one recommended action each. Separate observation from causal claims.

## Requires

- Python 3.10+
- Pandas, NumPy, Seaborn, Plotly

## Known limitations

Needs the user's dataset to be provided; it does not fetch data and cannot confirm business causes from correlations alone.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Python Sales EDA and Profitability Analysis skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does Python Sales EDA and Profitability Analysis do?

Clean and analyze sales data in Python: KPIs, discount and margin analysis, RFM customer segments, and an interactive Plotly dashboard.

### Which AI agents support Python Sales EDA and Profitability Analysis?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use Python Sales EDA and Profitability Analysis?

Connect your AI agent to Agensi through MCP, then ask it to use Python Sales EDA and Profitability Analysis on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
