code: def trim_mean(a, proportiontocut, axis=0):
      """
      Return mean of array after trimming observations from both tails.
  
      If `proportiontocut` = 0.1, slices off 'leftmost' and 'rightmost' 10% of
      scores. Slices off LESS if proportion results in a non-integer slice
      index (i.e., conservatively slices off `proportiontocut` ).
  
      Parameters
      ----------
      a : array_like
          Input array
      proportiontocut : float
          Fraction to cut off at each tail of the sorted observations.
      axis : int or None
          Axis along which the trimmed means are computed. The default is axis=0.
          If axis is None then the trimmed mean will be computed for the
          flattened array.
  
      Returns
      -------
      trim_mean : ndarray
          Mean of trimmed array.
  
      """
      newa = trimboth(np.sort(a, axis), proportiontocut, axis=axis)
      return np.mean(newa, axis=axis)
  
file_path: statsmodels/statsmodels/stats/robust_compare.py
imports: import numbers
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: trim_mean(a, proportiontocut, axis) and returns: np