import numpy as np
# Start from Q3 rows only
df_q3 = df[df["quarter"] == "Q3-2025"].copy()
# Repeat each row a few times to simulate multiple accounts per
# product/region/sector
REPEATS_PER_GROUP = 8 # tweak to control density
df_accounts = df_q3.loc[df_q3.index.repeat(REPEATS_PER_GROUP)].copy()
# Create a simple account id
df_accounts["account_id"] = (
df_accounts["product_line"].str.replace(" ", "_").str.lower()
+ "-"
+ df_accounts.groupby("product_line").cumcount().astype(str)
)
# Split product-line revenue into pseudo account-level revenue with some noise
base_revenue = df_accounts["revenue_usd"] / REPEATS_PER_GROUP
df_accounts["account_revenue_usd"] = base_revenue * np.random.uniform(0.6, 1.4, size=len(df_accounts))
# Synthetic QoQ growth percentage for the scatter's Y-axis
df_accounts["qoq_revenue_growth_pct"] = np.random.uniform(-10.0, 30.0, size=len(df_accounts))
df_accounts