SQLDAXExcelPython
Leaderboard
pandas basicsMedium20 points

Bucket numbers into bands

Use pd.cut to label UnitPrice in products: Budget below 2000, Standard from 2000 to below 20000, Premium from 20000. Set result to the number of products in each band.

Show solutionLifetime

Real Python running in your browser through Pyodide, with pandas available. Nothing you type is sent to a server unless you save a score.

Python
Loading editor…

Press Ctrl+Enter or Run to see the result here.