Data Science, Simulation, Deep Dives, Hands On Tutorials, Product Analytics.
df.groupby('user_id', as_index = False).date.min()\ .rename(columns = {'date': 'cohort'}) new_users_stats_df = new_users_df.groupby('cohort')[['user_id']].count()\ .rename(columns = {'user_id': 'new_users'}) We can look at the data and see an overall growing trend with some seasonal effects (i.e.