Initializing playground…
← Back to examples

🏷️ Product Pricing Tiers

Scenario: An e-commerce merchandiser wants to bucket the catalogue into 4 price tiers (Budget / Mid / Premium / Luxury) and see the count and average margin per tier.

Skills: cut with custom labels, valueCounts, groupby.

1 · Bucket products into price tiers

Use fixed bin edges with cut and named labels.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

2 · Avg margin by tier

Strategy question: do premium products carry meaningfully higher margins?

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent