首页 > 解决方案 > 将二维列数组输入二维numpy数组

问题描述

将 2d 列向量输入到 2d numpy 数组(实际的 2d 数组)的“pythonic”方式是什么?下面的示例问题:

mu = np.array([[1, 2]]).T    
sigma_points = np.zeros((2, 2))
sigma_points[:, 0] = mu

编辑:

找到了:

  sigma_points[:, [0]] = mu

标签: numpy

解决方案


找到了:

  sigma_points[:, [0]] = mu

推荐阅读