擅长:python、mysql、java
<p>我的回答假设您的数据类型是NumPy数组,这从您的问题标题中可以清楚地看出。我只是把<code>np.array()</code>放在它周围,使它成为一个NumPy数组,因为我没有从中获得这个结构的数据帧。你知道吗</p>
<p>然后,您可以<code>flatten</code>将嵌套数组作为</p>
<pre><code>data = np.array([[259200.0] [259200.0] [259200.0]..., [260099.98] [260099.98] [260099.98]])
new_data = data.flatten()
# array([259200. , 259200. , 259200. , 260099.98, 260099.98, 260099.98])
</code></pre>
<p>或者使用<code>ravel</code>作为</p>
<pre><code>new_data = data.ravel()
# array([259200. , 259200. , 259200. , 260099.98, 260099.98, 260099.98])
</code></pre>