>>> import numpy as np
>>> np.array([[1,2,3],[4,5,6]]).flatten()
array([1, 2, 3, 4, 5, 6])
>>> np.array([[1,2,3],[4,5,6]]).flatten().tolist()
[1, 2, 3, 4, 5, 6]

  

 posted on 2021-06-30 22:36  boye169  阅读(206)  评论(0编辑  收藏  举报