我有一个如下所示的2D numpy数组,我想将其存储在pandas列中。我无法在搜索的任何地方找到相关示例。请帮助。谢谢!
#2D array
[[0,2],[2,3]]
#Expected output is pandas dataframe with single column :
[0,2]
[2,3]
IIUC使用:
a = np.array([[0,2],[2,3]])
s = pd.Series(a.tolist())
print (s)
0 [0, 2]
1 [2, 3]
dtype: object