5. Day-1 retention
MediumPandas & NumPy
Rows are events with user and day (0 = signup day). Day-1 retention is the share of users with an event on day 0 who also have an event on day 1. Return it rounded to 2 decimals (0.0 if nobody signed up).
Input rows arrive as a list of dictionaries; build a DataFrame with pd.DataFrame(rows).
Example 1
Input: users a, b on day 0; a returns on day 1 Output: 0.5
Constraints
A user may have several events per day