class_docstr: class for trimmed and winsorized one sample statistics
  
  axis is None, i.e. ravelling, is not supported
  
  Parameters
  ----------
  data : array-like
      The data, observations to analyze.
  fraction : float in (0, 0.5)
      The fraction of observations to trim at each tail.
      The number of observations trimmed at each tail is
      ``int(fraction * nobs)``
  is_sorted : boolean
      Indicator if data is already sorted. By default the data is sorted
      along ``axis``.
  axis : int
      The axis of reduce operations. By default axis=0, that is observations
      are along the zero dimension, i.e. rows if 2-dim.
code: def __init__(self, data, fraction, is_sorted=False, axis=0):
      self.data = np.asarray(data)
      # TODO: add pandas handling, maybe not if this stays internal
  
      self.axis = axis
      self.fraction = fraction
      self.nobs = nobs = self.data.shape[axis]
      self.lowercut = lowercut = int(fraction * nobs)
      self.uppercut = uppercut = nobs - lowercut
      if lowercut >= uppercut:
          raise ValueError("Proportion too big.")
      self.nobs_reduced = nobs - 2 * lowercut
  
      self.sl = [slice(None)] * self.data.ndim
      self.sl[axis] = slice(self.lowercut, self.uppercut)
      # numpy requires now tuple for indexing, not list
      self.sl = tuple(self.sl)
      if not is_sorted:
          self.data_sorted = np.sort(self.data, axis=axis)
      else:
          self.data_sorted = self.data
  
      # this only works for axis=0
      self.lowerbound = np.take(self.data_sorted, lowercut, axis=axis)
      self.upperbound = np.take(
          self.data_sorted, uppercut - 1, axis=axis
      )
  
file_path: statsmodels/statsmodels/stats/robust_compare.py
imports: import numbers
  import numpy
label_desc: Use image node_id 1 to create a new TrimmedMean object  with example: obj = TrimmedMean(data, fraction, is_sorted, axis)