Count distinct user_id per page and return as unique_users. Sort by page asc.
| event_id | user_id | page |
|---|---|---|
| 1 | 3 | pdp |
| 2 | 1 | home |
| 3 | 4 | search |
| 4 | 2 | home |
| 5 | 4 | cart |
| 6 | 2 | search |
These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].
events15 rows| event_id (int) | user_id (int) | page (string) |
|---|---|---|
| 1 | 3 | pdp |
| 2 | 1 | home |
| 3 | 4 | search |
| 4 | 2 | home |
| 5 | 4 | cart |
| 6 | 2 | search |
| 7 | 3 | home |
| 8 | 3 | home |
| 9 | 5 | search |
| 10 | 3 | pdp |
| 11 | 5 | home |
| 12 | 3 | search |
| 13 | 3 | search |
| 14 | 2 | cart |
| 15 | 1 | home |
Column names and order must match. Sort order is specified in the question.