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://bzwzjz.com/article/phjoe.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都做网站建设公司 成都网站建设 成都网站建设 成都网站建设 成都网站制作 企业网站建设 网站建设方案 营销型网站建设 四川成都网站制作 成都企业网站建设 网站制作 成都网站建设 网站建设费用 成都网站建设 四川成都网站建设 成都网站建设 广安网站设计 成都网站制作 成都网站建设 高端定制网站设计 网站建设 梓潼网站设计