我如何在不影响顺序的情况下将列表数组转换为项目数组?

问题描述 投票:0回答:1

我有一个看起来像这样的数组:

[list([130365]) list([80476]) list([999078, 999078]) list([86833, 86833])
 list([63767, 63767]) list([63777, 63777]) list([830166, 830166])]

>>> type(results)
<class 'numpy.ndarray'>

而且我想将其转换为仅包含项目的数组:

[130365 80476 999078 86833 86833 63767 63767 63777 63777 830166 830166]

到目前为止,我尝试过的所有方法都无效,我该怎么办?

python arrays python-3.x
1个回答
0
投票

您可以简单地使用from_iterable功能:

from_iterable
© www.soinside.com 2019 - 2024. All rights reserved.