快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

python关于矩阵重复赋值覆盖问题的解决方法-创新互联

本文实例讲述了python关于矩阵重复赋值覆盖问题的解决方法。分享给大家供大家参考,具体如下:

创新互联主营团风网站建设的网络公司,主营网站建设方案,APP应用开发,团风h5小程序开发搭建,团风网站营销推广欢迎团风等地区企业咨询
import itertools
import numpy as np
comb = list(itertools.combinations(list(range(regions)), 2))
bands_info = []
coeff = np.zeros([bands, len(comb)])
for cla in range(classes):
  class_info = data[:,cla*bands*regions:(cla+1)*bands*regions]
  for bs in range(bands):
    n = bs*regions
    for i in range(len(comb)):
      index1 = comb[i][0]+n
      index2 = comb[i][1]+n
      part1 = class_info[:, index1]
      part2 = class_info[:, index2]
      coeff[bs, i] = (np.corrcoef(part1, part2))[0, 1]
  bands_info.append(coeff.reshape([1,-1]))
coeff_info = np.vstack((bands_info[0], bands_info[1], bands_info[2],bands_info[3]))


网站栏目:python关于矩阵重复赋值覆盖问题的解决方法-创新互联
URL链接:http://6mz.cn/article/phjoe.html

其他资讯