sample_data
sample_data ¶
generate_cfo_sample_data ¶
generate_cfo_sample_data(
num_months: int = 12,
start_date: str = "2025-01-01",
*,
num_customers: int = 50,
seed: int | None = None
) -> DataFrame
Generate sample customer sales data for a CFO demo.
Columns
date: monthly period date customer_id: unique customer identifier customer_name: customer name region: sales region product: product category sales_amount: monthly sales amount units_sold: number of units cost_amount: cost of goods sold margin: sales_amount - cost_amount
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_months
|
int
|
Number of monthly periods to generate |
12
|
start_date
|
str
|
First month's date (YYYY-MM-DD) |
'2025-01-01'
|
num_customers
|
int
|
Number of distinct customers |
50
|
seed
|
int | None
|
Optional random seed for reproducibility |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
A pandas DataFrame with one row per customer per month. |
Source code in src/crew_dcs/utils/sample_data.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |