All pandas problems
HardWindows
Rank cities within each product
For each product, add a column that ranks the row by revenue within the product group (1 = highest). This is what SQL window functions look like in pandas.
- #window
- #rank
- #groupby-transform
Sample input
same sales CSV
Sample output
df with a new rank_within_product column (1, 2, 3...)
pd-window-rank.pyneeds: pandas
Output
Press "Run code" to execute.
