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 groupby(
      cls, dataset, dimensions, container_type, group_type, **kwargs
  ):
      # Get dimensions information
      dimensions = [dataset.get_dimension(d) for d in dimensions]
      kdims = [kdim for kdim in dataset.kdims if kdim not in dimensions]
      vdims = dataset.vdims
  
      # Update the kwargs appropriately for Element group types
      group_kwargs = {}
      group_type = dict if group_type == "raw" else group_type
      if issubclass(group_type, Element):
          group_kwargs.update(util.get_param_values(dataset))
          group_kwargs["kdims"] = kdims
      group_kwargs.update(kwargs)
  
      # Find all the keys along supplied dimensions
      keys = (
          tuple(
              dataset.data[d.name]
              if isscalar(dataset.data[d.name])
              else dataset.data[d.name][i]
              for d in dimensions
          )
          for i in range(len(dataset))
      )
  
      # Iterate over the unique entries applying selection masks
      grouped_data = []
      for unique_key in util.unique_iterator(keys):
          mask = cls.select_mask(
              dataset, dict(zip(dimensions, unique_key))
          )
          group_data = dict(
              (
                  d.name,
                  dataset.data[d.name]
                  if isscalar(dataset.data[d.name])
                  else dataset.data[d.name][mask],
              )
              for d in kdims + vdims
          )
          group_data = group_type(group_data, **group_kwargs)
          grouped_data.append((unique_key, group_data))
  
      if issubclass(container_type, NdMapping):
          with item_check(False), sorted_context(False):
              return container_type(grouped_data, kdims=dimensions)
      else:
          return container_type(grouped_data)
  
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 18 for calling the DictInterface obj's underlying member method code with example usage: obj.groupby(cls, dataset, dimensions, container_type, group_type) and returns: container_type, container_type