Data Science, Product Analytics, Simulation, Deep Dives, Programming.
lambda x: (x - datetime.timedelta(x.weekday())).strftime('%Y-%m-%d') ) period_stats_df = processed_requests_df.groupby('period')\ .aggregate({'id': 'count', 'handling_time_mins': 'mean', 'waiting_time_mins': 'mean', 'resolution_time_mins': 'mean'})\