code: def aggregate_group_loop(*args, **kwargs):
      
      func = kwargs['func']
      del kwargs['func']
      return aggregate_np(*args, func=lambda x: func(x), **kwargs)
docs: wraps func in lambda which prevents aggregate_numpy from
      recognising and optimising it. Instead it groups and loops.