code: def seasonal_mean(x, period):
      """
      Return means for each period in x. period is an int that gives the
      number of periods per cycle. E.g., 12 for monthly. NaNs are ignored
      in the mean.
      """
      return np.array(
          [pd_nanmean(x[i::period], axis=0) for i in range(period)]
      )
  
imports: import numpy
  import pandas
  from pandas.core.nanops import nanmean
  from statsmodels.tools.validation import PandasWrapper, array_like
  from statsmodels.tsa.stl._stl import STL
  from statsmodels.tsa.filters.filtertools import convolution_filter
  from statsmodels.tsa.stl.mstl import MSTL
  from statsmodels.tsa.tsatools import freq_to_period
label_desc: Use image node_id 2 for calling a global function with example usage: seasonal_mean(x, period) and returns: np