code: def compute_pearson_r(self, signal, estimator):
      from scipy.stats import pearsonr
  
      signal_std = np.std(signal)
      estimator_std = np.std(estimator)
      # print("PEARSONR_DETAIL1" , signal_std, estimator_std)
      # print("PEARSONR_DETAIL2" , signal)
      # print("PEARSONR_DETAIL3" , estimator)
      lEps = 1e-8
      r = 0.0
      if (
          (signal_std > lEps)
          and (estimator_std > lEps)
          and (signal.shape[0] > 30)
      ):
          # this is a temporary work-around for the issue
          # scipy.stats.pearsonr overflows with high values of x and y #8980
          # https://github.com/scipy/scipy/issues/8980
          sig_z = (signal.values - np.mean(signal.values)) / signal_std
          est_z = (
              estimator.values - np.mean(estimator.values)
          ) / estimator_std
          (r, pval) = pearsonr(sig_z, est_z)
      return r
  
file_path: atspy/atspy/TS/Perf.py
imports: import pandas
  import numpy
  from .None import Utils
label_desc: Use image node_id 7 for calling the cPerf obj's underlying member method code with example usage: obj.compute_pearson_r(signal, estimator) and returns: r