AnalystPath

Creators With Year-Over-Year Growth

PandasHardSenior level~10 min

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
upload_idcreator_idrun_datepayout
112019-07-011100
212019-11-011200
312020-05-263000
412021-08-313100
512022-12-074700

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 upload

Solve 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

Related Pandas questions