class_docstr: The cuDFInterface allows a Dataset objects to wrap a cuDF
  DataFrame object. Using cuDF allows working with columnar
  data on a GPU. Most operations leave the data in GPU memory,
  however to plot the data it has to be loaded into memory.
  
  The cuDFInterface covers almost the complete API exposed
  by the PandasInterface with two notable exceptions:
  
  1) Aggregation and groupby do not have a consistent sort order
     (see https://github.com/rapidsai/cudf/issues/4237)
  3) Not all functions can be easily applied to a cuDF so
     some functions applied with aggregate and reduce will not work.
class_docstr_tok: ["The","cuDFInterface","allows","a","Dataset","objects","to","wrap","a","cuDF","DataFrame","object",".","Using","cuDF","allows","working","with","columnar","data","on","a","GPU",".","Most","operations","leave","the","data","in","GPU","memory",",","however","to","plot","the","data","it","has","to","be","loaded","into","memory",".","The","cuDFInterface","covers","almost","the","complete","API","exposed","by","the","PandasInterface","with","two","notable","exceptions",":","1",")","Aggregation","and","groupby","do","not","have","a","consistent","sort","order","(","see","https",":","\/\/github.com\/rapidsai\/cudf\/issues\/4237",")","3",")","Not","all","functions","can","be","easily","applied","to","a","cuDF","so","some","functions","applied","with","aggregate","and","reduce","will","not","work","."]
code: def aggregate(cls, dataset, dimensions, function, **kwargs):
      data = dataset.data
      cols = [d.name for d in dataset.kdims if d in dimensions]
      vdims = dataset.dimensions("value", label="name")
      reindexed = data[cols + vdims]
      agg = function.__name__
      if len(dimensions):
          agg_map = {"amin": "min", "amax": "max"}
          agg = agg_map.get(agg, agg)
          grouped = reindexed.groupby(cols, sort=False)
          if not hasattr(grouped, agg):
              raise ValueError(
                  f"{agg} aggregation is not supported on cudf DataFrame."
              )
          df = getattr(grouped, agg)().reset_index()
      else:
          agg_map = {"amin": "min", "amax": "max", "size": "count"}
          agg = agg_map.get(agg, agg)
          if not hasattr(reindexed, agg):
              raise ValueError(
                  f"{agg} aggregation is not supported on cudf DataFrame."
              )
          agg = getattr(reindexed, agg)()
          try:
              data = {
                  col: [v]
                  for col, v in zip(
                      agg.index.values_host, agg.to_numpy()
                  )
              }
          except Exception:
              # Give FutureWarning: 'The to_array method will be removed in a future cuDF release.
              # Consider using `to_numpy` instead.'
              # Seen in cudf=21.12.01
              data = {
                  col: [v]
                  for col, v in zip(
                      agg.index.values_host, agg.to_array()
                  )
              }
          df = pd.DataFrame(data, columns=list(agg.index.values_host))
  
      dropped = []
      for vd in vdims:
          if vd not in df.columns:
              dropped.append(vd)
      return df, dropped
  
imports: import sys
  import warnings
  from itertools import product
  import numpy
  import pandas
  from ..None import util
  from ..dimension import dimension_name
  from ..element import Element
  from ..ndmapping import NdMapping, item_check, sorted_context
  from .interface import DataError, Interface
  from .pandas import PandasInterface
  from .util import finite_range
label_desc: Use image node_id 11 for calling the cuDFInterface obj's underlying member method code with example usage: obj.aggregate(cls, dataset, dimensions, function) and returns: df,  dropped