code: def drop_duplicates_agg(df,colsgroupby,cols2aggf,test=False):
      
      if test:
          print(df.shape)
          print(df.drop_duplicates(subset=colsgroupby).shape)
      #ddup aggregated
      dfdupagg=df.loc[(df.duplicated(subset=colsgroupby,keep=False)),:].groupby(colsgroupby).agg(cols2aggf)
      #drop duplicates all
      df_=df.drop_duplicates(subset=colsgroupby,keep=False)
      if test:
          print(df_.shape)
      #append ddup aggregated
      dfout=df_.append(dfdupagg,sort=True)
      if test:
          print(dfout.shape)
      return dfout
docs: colsgroupby: unique names ~index
      cols2aggf: rest of the cols `unique_dropna_str` for categories