code: def _normalize_for_correlation(data, axis, return_nans=False):
      
      shape = data.shape
      data = zscore(data, axis=axis, ddof=0)
      # if zscore fails (standard deviation is zero),
      # optionally set all values to be zero
      if not return_nans:
          data = np.nan_to_num(data)
      data = data / math.sqrt(shape[axis])
      return data
docs: normalize the data before computing correlation
  
      The data will be z-scored and divided by sqrt(n)
      along the assigned axis
  
      Parameters
      ----------
      data: 2D array
  
      axis: int
          specify which dimension of the data should be normalized
  
      return_nans: bool, default:False
          If False, return zeros for NaNs; if True, return NaNs
  
      Returns
      -------
      data: 2D array
          the normalized data