class_docstr: Compute boxplot statistics
  
  {usage}
  
  Parameters
  ----------
  {common_parameters}
  coef : float, default=1.5
      Length of the whiskers as a multiple of the Interquartile
      Range.
  
  See Also
  --------
  plotnine.geoms.geom_boxplot
class_docstr_tok: ["Compute","boxplot","statistics","{","usage","}","Parameters","--","--","--","--","--","{","common_parameters","}","coef",":","float",",","default=1.5","Length","of","the","whiskers","as","a","multiple","of","the","Interquartile","Range",".","See","Also","--","--","--","--","plotnine.geoms.geom_boxplot"]
code: def compute_group(cls, data, scales, **params):
      n = len(data)
      y = data["y"].to_numpy()
      if "weight" in data:
          weights = data["weight"]
          total_weight = np.sum(weights)
      else:
          weights = None
          total_weight = len(y)
      res = weighted_boxplot_stats(
          y, weights=weights, whis=params["coef"]
      )
  
      if len(np.unique(data["x"])) > 1:
          width = np.ptp(data["x"]) * 0.9
      else:
          width = params["width"]
  
      if isinstance(data["x"].dtype, pd.CategoricalDtype):
          x = data["x"].iloc[0]
      else:
          x = np.mean([data["x"].min(), data["x"].max()])
  
      d = {
          "ymin": res["whislo"],
          "lower": res["q1"],
          "middle": [res["med"]],
          "upper": res["q3"],
          "ymax": res["whishi"],
          "outliers": [res["fliers"]],
          "notchupper": res["cihi"],
          "notchlower": res["cilo"],
          "x": x,
          "width": width,
          "relvarwidth": np.sqrt(total_weight),
          "n": n,
      }
      return pd.DataFrame(d)
  
file_path: plotnine/plotnine/stats/stat_boxplot.py
imports: import numpy
  import pandas
  from .._utils import resolution
  from ..doctools import document
  from .stat import stat
label_desc: Use image node_id 3 for calling the stat_boxplot obj's underlying member method code with example usage: obj.compute_group(cls, data, scales) and returns: pd