class_docstr: Interface for simple dictionary-based dataset format. The dictionary
  keys correspond to the column (i.e. dimension) names and the values
  are collections representing the values in that column.
class_docstr_tok: ["Interface","for","simple","dictionary-based","dataset","format",".","The","dictionary","keys","correspond","to","the","column","(","i.e",".","dimension",")","names","and","the","values","are","collections","representing","the","values","in","that","column","."]
code: def aggregate(cls, dataset, kdims, function, **kwargs):
      kdims = [
          dataset.get_dimension(d, strict=True).name for d in kdims
      ]
      vdims = dataset.dimensions("value", label="name")
      groups = cls.groupby(dataset, kdims, list, dict)
      aggregated = dict([(k, []) for k in kdims + vdims])
  
      dropped = []
      for key, group in groups:
          key = key if isinstance(key, tuple) else (key,)
          for kdim, val in zip(kdims, key):
              aggregated[kdim].append(val)
          for vdim, arr in group.items():
              if vdim in dataset.vdims:
                  if isscalar(arr):
                      aggregated[vdim].append(arr)
                      continue
                  try:
                      if isinstance(function, np.ufunc):
                          reduced = function.reduce(arr, **kwargs)
                      else:
                          reduced = function(arr, **kwargs)
                      aggregated[vdim].append(reduced)
                  except TypeError:
                      dropped.append(vdim)
      return aggregated, list(util.unique_iterator(dropped))
  
imports: from collections import OrderedDict, defaultdict
  import numpy
  from ..None import util
  from ..dimension import dimension_name
  from ..element import Element
  from ..ndmapping import NdMapping, item_check, sorted_context
  from ..util import isscalar
  from .interface import DataError, Interface
label_desc: Use image node_id 21 for calling the DictInterface obj's underlying member method code with example usage: obj.aggregate(cls, dataset, kdims, function) and returns: aggregated,  list