我们专注攀枝花网站设计 攀枝花网站制作 攀枝花网站建设
成都网站建设公司服务热线:400-028-6601

网站建设知识

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

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

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关于矩阵重复赋值覆盖问题的解决方法-创新互联
文章网址:http://mswzjz.cn/article/phjoe.html

其他资讯