code: def aggregateStatsDF(stats_df):
      ''' return a dataframe with aggregated counts per UMI'''
  
      grouped = stats_df.groupby("UMI")
  
      agg_dict = {'counts': [np.median, len, np.sum]}
      agg_df = grouped.agg(agg_dict)
  
      agg_df.columns = ['median_counts', 'times_observed', 'total_counts']
      return agg_df aggregateStatsDF(stats_df):
      ''' return a dataframe with aggregated counts per UMI'''
  
      grouped = stats_df.groupby("UMI")
  
      agg_dict = {'counts': [np.median, len, np.sum]}
      agg_df = grouped.agg(agg_dict)
  
      agg_df.columns = ['median_counts', 'times_observed', 'total_counts']
      return agg_df
docs: return a dataframe with aggregated counts per UMI