docstr: Data aggregator that produces a weighted estimate and error bar interval.
  
  Parameters
  ----------
  estimator : string
      Function (or method name) that maps a vector to a scalar. Currently
      supports only "mean".
  errorbar : string or (string, number) tuple
      Name of errorbar method or a tuple with a method name and a level parameter.
      Currently the only supported method is "ci".
  boot_kws
      Additional keywords are passed to bootstrap when error_method is "ci".
docstr_tok: ["Data","aggregator","that","produces","a","weighted","estimate","and","error","bar","interval",".","Parameters","--","--","--","--","--","estimator",":","string","Function","(","or","method","name",")","that","maps","a","vector","to","a","scalar",".","Currently","supports","only","``","mean","''",".","errorbar",":","string","or","(","string",",","number",")","tuple","Name","of","errorbar","method","or","a","tuple","with","a","method","name","and","a","level","parameter",".","Currently","the","only","supported","method","is","``","ci","''",".","boot_kws","Additional","keywords","are","passed","to","bootstrap","when","error_method","is","``","ci","''","."]
code: def __init__(self, estimator, errorbar=None, **boot_kws):
      """
      Data aggregator that produces a weighted estimate and error bar interval.
  
      Parameters
      ----------
      estimator : string
          Function (or method name) that maps a vector to a scalar. Currently
          supports only "mean".
      errorbar : string or (string, number) tuple
          Name of errorbar method or a tuple with a method name and a level parameter.
          Currently the only supported method is "ci".
      boot_kws
          Additional keywords are passed to bootstrap when error_method is "ci".
  
      """
      if estimator != "mean":
          # Note that, while other weighted estimators may make sense (e.g. median),
          # I'm not aware of an implementation in our dependencies. We can add one
          # in seaborn later, if there is sufficient interest. For now, limit to mean.
          raise ValueError(
              f"Weighted estimator must be 'mean', not {estimator!r}."
          )
      self.estimator = estimator
  
      method, level = _validate_errorbar_arg(errorbar)
      if method is not None and method != "ci":
          # As with the estimator, weighted 'sd' or 'pi' error bars may make sense.
          # But we'll keep things simple for now and limit to (bootstrap) CI.
          raise ValueError(
              f"Error bar method must be 'ci', not {method!r}."
          )
      self.error_method = method
      self.error_level = level
  
      self.boot_kws = boot_kws
  
imports: from numbers import Number
  from statistics import NormalDist
  import numpy
  import pandas
  from .algorithms import bootstrap
  from .utils import _check_argument
label_desc: Use image node_id 1 to create a new WeightedAggregator object  with example: obj = WeightedAggregator(estimator, errorbar)