当前位置:   article > 正文

operands could not be broadcast together with shapes

operands could not be broadcast together with shapes (7,2000) (5,1)

矩阵维度不一样不能相加

要是向量拼接 可以参考

  1. for i in data:
  2. "0位置向量化"
  3. vec_0=[int(i) for i in compileX.findall(str(i[0]))]
  4. "1位置向量化 "
  5. vec_1=data_1_vec[list(set(data[:,1])).index(i[1])]
  6. "4位置向量化 "
  7. vec_4 = data_4_vec[list(set(data[:, 4])).index(i[4])]
  8. "2位置向量化"
  9. vec_2 = [int(i) for i in compileX.findall(str(i[2]))]
  10. print(vec_0,vec_1,vec_2,vec_4)
  11. data_vec.append(list(vec_0)+list(vec_1)+list(vec_2)+list(vec_4))

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/948380
推荐阅读
相关标签
  

闽ICP备14008679号