我想在一个数组中堆叠多个数组,并保持所有
的数据类型为float使用此声明
transition = np.hstack((s, [np.vstack(a).astype(np.float), r, d], s_))
目前的输出
[1502.0 1469.0 1563.0 1610.0 1637.0 1625.0 1580.0 1453.0 1264.0 1201.0
1352.0 1526.0 1738.0 1788.0 1786.0 1709.0 1669.0 1621.0 1618.0 1651.0
1655.0 1672.0 1671.0 1683.0 1555.2589513700764
array([[256.],
[ 69.],
[484.]]) 6329 True 1469.0 1563.0
1610.0 1637.0 1625.0 1580.0 1453.0 1264.0 1201.0 1352.0 1526.0 1738.0
1788.0 1786.0 1709.0 1669.0 1621.0 1618.0 1651.0 1655.0 1672.0 1671.0
1683.0 1555.2589513700764 1541.0463344821703]
我想删除数组部分并使其平滑
[1502.0 1469.0 1563.0 1610.0 1637.0 1625.0 1580.0 1453.0 1264.0 1201.0
1352.0 1526.0 1738.0 1788.0 1786.0 1709.0 1669.0 1621.0 1618.0 1651.0
1655.0 1672.0 1671.0 1683.0 1555.2589513700764
256. 69. 484. 6329 True 1469.0 1563.0 1610.0 1637.0 1625.0 1580.0 1453.0 1264.0 1201.0 1352.0 1526.0 1738.0 1788.0 1786.0 1709.0 1669.0 1621.0 1618.0 1651.0 1655.0 1672.0 1671.0 1683.0 1555.2589513700764 1541.0463344821703]
答案 0 :(得分:0)
看起来你只想要
np.concatenate((s, a, [r, d], s_))