code: def test_trim_mean(self):
      # a = np.array([4, 8, 2, 0, 9, 5, 10, 1, 7, 3, 6])
      idx = np.array([3, 5, 0, 1, 2, 4])
      a2 = np.arange(24).reshape(6, 4)[idx, :]
      a3 = np.arange(24).reshape(6, 4, order="F")[idx, :]
      assert_equal(
          trim_mean(a3, 2 / 6.0), np.array([2.5, 8.5, 14.5, 20.5])
      )
      assert_equal(
          trim_mean(a2, 2 / 6.0), np.array([10.0, 11.0, 12.0, 13.0])
      )
      idx4 = np.array([1, 0, 3, 2])
      a4 = np.arange(24).reshape(4, 6)[idx4, :]
      assert_equal(
          trim_mean(a4, 2 / 6.0),
          np.array([9.0, 10.0, 11.0, 12.0, 13.0, 14.0]),
      )
      # shuffled arange(24)
      a = np.array(
          [
              7,
              11,
              12,
              21,
              16,
              6,
              22,
              1,
              5,
              0,
              18,
              10,
              17,
              9,
              19,
              15,
              23,
              20,
              2,
              14,
              4,
              13,
              8,
              3,
          ]
      )
      assert_equal(trim_mean(a, 2 / 6.0), 11.5)
      assert_equal(trim_mean([5, 4, 3, 1, 2, 0], 2 / 6.0), 2.5)
  
      # check axis argument
      np.random.seed(1234)
      a = np.random.randint(20, size=(5, 6, 4, 7))
      for axis in [0, 1, 2, 3, -1]:
          res1 = trim_mean(a, 2 / 6.0, axis=axis)
          res2 = trim_mean(np.rollaxis(a, axis), 2 / 6.0)
          assert_equal(res1, res2)
  
      res1 = trim_mean(a, 2 / 6.0, axis=None)
      res2 = trim_mean(a.ravel(), 2 / 6.0)
      assert_equal(res1, res2)
  
imports: import numpy
  from numpy.testing import assert_equal, assert_allclose, assert_raises
  import pytest
  from statsmodels.stats.robust_compare import TrimmedMean, trim_mean, trimboth
  import statsmodels.stats.oneway
  from statsmodels.tools.testing import Holder
  from scipy.stats import trim1
label_desc: Use image node_id 3 for calling the Test_Trim obj's underlying member method code with example usage: obj.test_trim_mean() without return types