class_docstr: Singular Spectrum Analysis object
class_docstr_tok: ["Singular","Spectrum","Analysis","object"]
docstr: Performs anti-diagonal averaging from given hankel matrix
  Returns: Pandas DataFrame object containing the reconstructed series
docstr_tok: ["Performs","anti-diagonal","averaging","from","given","hankel","matrix","Returns",":","Pandas","DataFrame","object","containing","the","reconstructed","series"]
code: def diagonal_averaging(hankel_matrix):
      """Performs anti-diagonal averaging from given hankel matrix
      Returns: Pandas DataFrame object containing the reconstructed series
      """
      mat = m(hankel_matrix)
      L, K = mat.shape
      L_star, K_star = min(L, K), max(L, K)
      new = np.zeros((L, K))
      if L > K:
          mat = mat.T
      ret = []
  
      # Diagonal Averaging
      for k in range(1 - K_star, L_star):
          mask = np.eye(K_star, k=k, dtype="bool")[::-1][:L_star, :]
          mask_n = sum(sum(mask))
          ma = np.ma.masked_array(mat.A, mask=1 - mask)
          ret += [ma.sum() / mask_n]
  
      return pd.DataFrame(ret).rename(columns={0: "Reconstruction"})
  
imports: import numpy
  import pandas
  from numpy import matrix
  from scipy import linalg
  from matplotlib.pylab import rcParams
label_desc: Use image node_id 4 for calling the mySSA obj's underlying member method code with example usage: obj.diagonal_averaging(hankel_matrix) and returns: pd