1 使用vstack 

但是vstack 和 hstack都不能融合行向量,所以不好在循环中使用同一个操作

 

2 使用list,逐步添加. 在需要的时候转换成np.array 并转置

chosen_features = []
chosen_features.append(features[:, num_features-2])
chosen_features.append(features[:, num_features-1])

np.array(chosen_features).T

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2021-09-21
  • 2022-02-17
  • 2021-11-01
  • 2022-12-23
  • 2021-12-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案