Creators With Year-Over-Year Growth
Problem
You are given a DataFrame `upload` (from `upload.csv`) with columns `upload_id`, `creator_id`, `run_date` (a date), and `payout`.
For each creator, total their payout per calendar year. A creator qualifies if their yearly total strictly increased every year from their first upload year to their last upload year. Any year inside that span with no uploads counts as a total of 0. A creator active in only a single year qualifies trivially. Return the `creator_id` of all qualifying creators. Order does not matter.
Input data
Example rows — the live problem includes the full dataset.
| upload_id | creator_id | run_date | payout |
|---|---|---|---|
| 1 | 1 | 2019-07-01 | 1100 |
| 2 | 1 | 2019-11-01 | 1200 |
| 3 | 1 | 2020-05-26 | 3000 |
| 4 | 1 | 2021-08-31 | 3100 |
| 5 | 1 | 2022-12-07 | 4700 |
Expected output
Your answer should return 1 row with the columns creator_id.
Starter code (Pandas (Python))
import pandas as pd
def creators_with_year_over_year_growth(upload) -> pd.DataFrame:
# Your code here
return uploadSolve this Pandas question free
Write Pandas (Python) and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock