Every growth deck has a retention curve in it, and building the grid behind it touches almost everything else in this arena: period arithmetic that has to mean calendar months rather than a day count, a denominator that must not shift once it is set, and a grid that has to include the cells where nothing happened.
Write retention_matrix(df). Given a DataFrame of activity events with user_id and event_date (datetime64):
"YYYY-MM".0 for the cohort month itself, 1 for the next calendar month, and so on — this is calendar-month arithmetic, not a count of 30-day spans).(cohort, period) cell is the number of distinct users from that cohort who had at least one event in that period.active_users / cohort_size * 100, rounded to 1 decimal place.Return one row per (cohort, period) with columns cohort, period, cohort_size, active_users, retention_pct. Every cohort must have a row for every period from 0 up to the largest period reached by any cohort in the data, even periods that cohort itself has no events in yet — those get active_users = 0 and retention_pct = 0.0.
Sorted by cohort ascending, then period ascending. An empty input returns an empty frame with these columns.
Build the architecture on a canvas: place the components, configure them, connect them into a data flow, and write a short reason for each one. The AI reviewer grades your design against a rubric written specifically for this problem.
Minimum 5 components · needs a wide desktop screen