code: def _Moran_BV_Matrix_array(variables, w, permutations=0, varnames=None):
      
      if varnames is None:
          varnames = ['x{}'.format(i) for i in range(k)]
  
      k = len(variables)
      rk = list(range(0, k - 1))
      results = {}
      for i in rk:
          for j in range(i + 1, k):
              y1 = variables[i]
              y2 = variables[j]
              results[i, j] = Moran_BV(y1, y2, w, permutations=permutations)
              results[j, i] = Moran_BV(y2, y1, w, permutations=permutations)
              results[i, j].varnames = {'x': varnames[i], 'y': varnames[j]}
              results[j, i].varnames = {'x': varnames[j], 'y': varnames[i]}
      return results
docs: Base calculation for MORAN_BV_Matrix