我在ipython3
中进行实验,在这里我创建了一个数组:
In [105]: counts_array
Out[105]:
array([array([ 17, 59, 320, ..., 1, 7, 0], dtype=uint32),
array([ 30, 71, 390, ..., 12, 20, 6], dtype=uint32),
array([ 7, 145, 214, ..., 4, 12, 0], dtype=uint32),
array([ 23, 346, 381, ..., 15, 19, 5], dtype=uint32),
array([ 51, 78, 270, ..., 3, 0, 2], dtype=uint32),
array([212, 149, 511, ..., 19, 31, 8], dtype=uint32)], dtype=object)
In [106]: counts_array.shape
Out[106]: (6,)
In [107]: counts_array[0].shape
Out[107]: (1590,)
我想从我创建的怪物那里获得一个普通的shape=(6, 1590), dtype=uint32
数组。你知道吗
我该怎么做?你知道吗
经过各种实验,结果证明,以下简单语法正好起作用:
我的第一个工作版本很复杂:
你可以使用^{} -
另一种方法是^{} -
样本运行-
你考虑过
numpy.vstack()
吗? 我经常用它来做这种手术。你知道吗相关问题 更多 >
编程相关推荐