class_docstr: StatisticsElement provides a baseclass for Element types that
  compute statistics based on the input data, usually a density.
  The value dimension of such elements are therefore usually virtual
  and not computed until the element is plotted.
class_docstr_tok: ["StatisticsElement","provides","a","baseclass","for","Element","types","that","compute","statistics","based","on","the","input","data",",","usually","a","density",".","The","value","dimension","of","such","elements","are","therefore","usually","virtual","and","not","computed","until","the","element","is","plotted","."]
code: def __init__(self, data, kdims=None, vdims=None, **params):
      if (
          isinstance(data, Element)
          and data.interface.datatype != "dataframe"
      ):
          params.update(get_param_values(data))
          kdims = kdims or data.dimensions()[: len(self.kdims)]
          data = tuple(data.dimension_values(d) for d in kdims)
      params.update(dict(kdims=kdims, vdims=[], _validate_vdims=False))
      super().__init__(data, **params)
      if not vdims:
          self.vdims = [Dimension("Density")]
      elif len(vdims) > 1:
          raise ValueError(
              f"{type(self).__name__} expects at most one vdim."
          )
      else:
          self.vdims = process_dimensions(None, vdims)["vdims"]
  
imports: import numpy
  import param
  from ..core.data import Dataset
  from ..core.dimension import Dimension, process_dimensions
  from ..core.element import Element, Element2D
  from ..core.util import get_param_values, unique_iterator
  from .selection import Selection1DExpr, Selection2DExpr
label_desc: Use image node_id 1 to create a new StatisticsElement object from inherited base classes: Dataset, Element2D with example: obj = StatisticsElement(data, kdims, vdims)