What is Business Analytics? #
Business Analytics is the process of using data, statistics, and tools to make business decisions.
It helps businesses:
- Improve performance
- Increase revenue
- Understand customers
- Optimize operations
Types of Business Analytics #
| Type | Description | Example |
|---|---|---|
| Descriptive | What happened? | Monthly sales report |
| Diagnostic | Why it happened? | Why sales dropped |
| Predictive | What will happen? | Forecast future sales |
| Prescriptive | What to do? | Suggest best strategy |
What is Sales Analysis? #
Sales analysis is the process of evaluating sales data to understand performance and trends.
Key Metrics in Sales Analysis #
| Metric | Meaning |
|---|---|
| Total Sales | Overall revenue |
| Sales Growth | Increase/decrease over time |
| Average Order Value | Revenue per order |
| Top Products | Best-selling items |
| Sales by Region | Geographic performance |
Example Dataset #
import pandas as pd
data = {
"Product": ["A", "B", "C", "A", "B"],
"Sales": [100, 200, 150, 300, 250],
"Region": ["East", "West", "East", "West", "East"]
}
df = pd.DataFrame(data)Basic Sales Analysis Code #
Total Sales #
total_sales = df["Sales"].sum()
print("Total Sales:", total_sales)Sales by Product
sales_by_product = df.groupby("Product")["Sales"].sum()
print(sales_by_product)Sales by Region
sales_by_region = df.groupby("Region")["Sales"].sum()
print(sales_by_region)Insights You Can Get #
- Which product sells the most
- Which region performs best
- Sales trends over time
Helps in:
- Inventory planning
- Marketing strategies
- Pricing decisions
Customer Behavior Analysis #
What is Customer Behavior Analysis? #
It is the process of understanding how customers interact with a business.
Focus:
- Buying patterns
- Preferences
- Engagement
Key Metrics #
| Metric | Meaning |
|---|---|
| Customer Segmentation | Grouping customers |
| Purchase Frequency | How often customers buy |
| Customer Lifetime Value (CLV) | Total value of a customer |
| Churn Rate | Customers leaving |
| Retention Rate | Customers staying |
Example Dataset #
data = {
"Customer": ["Alex", "John", "Emma", "Alex", "Emma"],
"Purchase": [100, 200, 150, 300, 250]
}
df = pd.DataFrame(data)Basic Customer Analysis Code #
Total Spending per Customer #
customer_spending = df.groupby("Customer")["Purchase"].sum()
print(customer_spending)Purchase Frequency
purchase_freq = df["Customer"].value_counts() print(purchase_freq)
Insights You Can Get #
- High-value customers
- Frequent buyers
- Customer preferences
Helps in:
- Targeted marketing
- Personalization
- Customer retention strategies
Sales vs Customer Behavior #
| Aspect | Sales Analysis | Customer Behavior |
|---|---|---|
| Focus | Revenue & products | Customer actions |
| Goal | Increase sales | Understand customers |
| Example | Best-selling product | Frequent buyers |
Simple Workflow #
- Collect sales & customer data
- Clean and prepare data
- Analyze sales metrics
- Analyze customer behavior
- Generate insights
- Make business decisions

