code: def mean_crossings(X):
      """Computes number of mean crossings for each variable in a segmented time series"""
      X = np.atleast_3d(X)
      N = X.shape[0]
      D = X.shape[2]
      mnx = np.zeros((N, D))
      for i in range(D):
          pos = X[:, :, i] > 0
          npos = ~pos
          c = (pos[:, :-1] & npos[:, 1:]) | (npos[:, :-1] & pos[:, 1:])
          mnx[:, i] = np.count_nonzero(c, axis=1)
      return mnx
  
imports: import numpy
  from scipy import stats
label_desc: Use image node_id 23 for calling a global function with example usage: mean_crossings(X) and returns: mnx