Datasets¶
Practice datasets for course exercises and projects. All are small enough to load instantly and large enough to be realistic.
Available Datasets¶
retail_sales.csv — 500 rows¶
E-commerce order data for a fictional retailer operating across 4 regions in 2023.
| Column | Type | Description |
|---|---|---|
| order_id | string | Unique order identifier |
| order_date | date | Date of purchase (YYYY-MM-DD) |
| customer_id | string | Customer identifier (1 customer can have multiple orders) |
| segment | categorical | Consumer / Corporate / Home Office |
| region | categorical | North / South / East / West |
| category | categorical | Electronics / Clothing / Books / Home & Garden / Sports |
| quantity | integer | Number of units ordered |
| unit_price | float | Price per unit before discount |
| discount | float | Discount fraction applied (0, 0.05, 0.10, 0.15, 0.20) |
| revenue | float | Final revenue = quantity × unit_price × (1 - discount) |
Good for: GroupBy, aggregation, time-series analysis, Pandas advanced, visualization.
customer_behaviour.csv — 400 rows¶
Customer attributes and churn labels for a fictional subscription service. Contains intentional missing values (~5–6%) in monthly_spend and satisfaction_score.
| Column | Type | Description |
|---|---|---|
| customer_id | string | Unique customer identifier |
| age | integer | Customer age in years |
| annual_income | integer | Annual income in USD |
| tenure_months | integer | Months as a customer |
| education | ordinal | High School / Bachelor / Master / PhD |
| country | categorical | USA / UK / Canada / Germany / India |
| monthly_spend | float | Average monthly spend (has ~6% missing) |
| satisfaction_score | integer | Survey score 1–10 (has ~4% missing) |
| has_premium | binary | 1 if subscribed to premium plan |
| support_tickets | integer | Number of support tickets raised |
| churned | binary | Target variable — 1 if customer churned |
Good for: classification, feature engineering, missing value imputation, Pipeline practice.
churn = pd.read_csv('customer_behaviour.csv')
print(churn['churned'].value_counts()) # Check class balance
movie_reviews.csv — 340 rows¶
Short movie reviews with sentiment labels. Suitable for text classification exercises without requiring any download.
| Column | Type | Description |
|---|---|---|
| review_id | integer | Unique review identifier |
| text | string | Review text (1–3 sentences) |
| sentiment | categorical | positive / negative / neutral |
| rating | integer | Star rating 1–10 |
Class distribution: 130 positive, 130 negative, 80 neutral.
Good for: NLP exercises, TF-IDF, text classification pipeline, Naive Bayes.
Loading from the Notebooks¶
If you are running a notebook from the notebooks/ folder, load the datasets with a relative path:
import pandas as pd
sales = pd.read_csv('../docs/Datasets/retail_sales.csv', parse_dates=['order_date'])
churn = pd.read_csv('../docs/Datasets/customer_behaviour.csv')
reviews = pd.read_csv('../docs/Datasets/movie_reviews.csv')
Why These Datasets?¶
These datasets were designed to teach specific skills:
- retail_sales — realistic categorical columns, discount math, and time dimension. Good for GroupBy and visualization exercises without any domain complexity.
- customer_behaviour — intentional missing values and a binary target with moderate class imbalance (~13% churn). Forces correct imputation and class-weight handling.
- movie_reviews — text data with three classes. Neutral reviews are deliberately harder to classify, which teaches students why multi-class NLP is harder than binary.