code: def test_ndarray(self):
      res_add = seasonal_decompose(self.data.values, period=4)
      assert_almost_equal(res_add.seasonal, SEASONAL, 2)
      assert_almost_equal(res_add.trend, TREND, 2)
      assert_almost_equal(res_add.resid, RANDOM, 3)
  
      res_mult = seasonal_decompose(
          np.abs(self.data.values), "m", period=4
      )
  
      assert_almost_equal(res_mult.seasonal, MULT_SEASONAL, 4)
      assert_almost_equal(res_mult.trend, MULT_TREND, 2)
      assert_almost_equal(res_mult.resid, MULT_RANDOM, 4)
  
      # test odd
      res_add = seasonal_decompose(self.data.values[:-1], period=4)
      seasonal = [
          68.18,
          69.02,
          -82.66,
          -54.54,
          68.18,
          69.02,
          -82.66,
          -54.54,
          68.18,
          69.02,
          -82.66,
          -54.54,
          68.18,
          69.02,
          -82.66,
          -54.54,
          68.18,
          69.02,
          -82.66,
          -54.54,
          68.18,
          69.02,
          -82.66,
          -54.54,
          68.18,
          69.02,
          -82.66,
          -54.54,
          68.18,
          69.02,
          -82.66,
      ]
      trend = [
          np.nan,
          np.nan,
          159.12,
          204.00,
          221.25,
          245.12,
          319.75,
          451.50,
          561.12,
          619.25,
          615.62,
          548.00,
          462.12,
          381.12,
          316.62,
          264.00,
          228.38,
          210.75,
          188.38,
          199.00,
          207.12,
          191.00,
          166.88,
          72.00,
          -9.25,
          -33.12,
          -36.75,
          36.25,
          103.00,
          np.nan,
          np.nan,
      ]
      random = [
          np.nan,
          np.nan,
          72.538,
          64.538,
          -42.426,
          -77.150,
          -12.087,
          -67.962,
          99.699,
          120.725,
          -2.962,
          -4.462,
          9.699,
          6.850,
          -38.962,
          -33.462,
          40.449,
          -40.775,
          22.288,
          -42.462,
          -43.301,
          168.975,
          -81.212,
          80.538,
          -15.926,
          -176.900,
          42.413,
          5.288,
          -46.176,
          np.nan,
          np.nan,
      ]
      assert_almost_equal(res_add.seasonal, seasonal, 2)
      assert_almost_equal(res_add.trend, trend, 2)
      assert_almost_equal(res_add.resid, random, 3)
  
imports: from statsmodels.compat.pandas import MONTH_END, QUARTER_END, YEAR_END
  import numpy
  from numpy.testing import assert_allclose, assert_almost_equal, assert_equal, assert_raises
  import pandas
  import pytest
  from statsmodels.tsa.seasonal import seasonal_decompose
label_desc: Use image node_id 2 for calling the TestDecompose obj's underlying member method code with example usage: obj.test_ndarray() without return types