I have a numpy array with a shape (47365L, 14L), I would like to convert it into make 2 column dataFrame where the first column is the id, which is the number of the column in my original array and the second one is the data which is the content of the column like in the image below.
I tried this code buut without success.
S.shape
>>(47365L, 14L)
IC_Label = ['sub_'+str(subNum) +'_IC_'+str(i) for i in range(0,S.shape[1])]
ICA_df=pd.DataFrame(data=S, columns= IC_Label)
output:
sub_1_IC_0 sub_1_IC_1 sub_1_IC_2 sub_1_IC_3 sub_1_IC_4 ............sub_1_IC_13
0 -0.002277 -0.003315 -0.001300 0.000283 0.000473
1 -0.004442 0.002921 0.000517 -0.000033 0.000349
2 -0.003370 0.006067 0.002504 -0.000359 0.001467
3 0.000075 0.004708 0.000087 -0.000176 0.002561
.
.
47364
My data looks like this:
('MyData', array([[ -2.27721244e-03, -3.31485020e-03, -1.30029316e-03, ...,
-1.33952356e-03, 2.93513841e-03, 1.22486268e-03],
[ -4.44161427e-03, 2.92134270e-03, 5.17394574e-04, ...,
-1.42587472e-03, 4.74996003e-03, 2.86699268e-03],
[ -3.36958390e-03, 6.06671900e-03, 2.50417650e-03, ...,
3.80042801e-03, 4.77244983e-03, 2.82142774e-03],
...,
[ 3.57952033e-04, -3.55516707e-04, 1.32481754e-03, ...,
7.55565993e-03, 1.52018736e-02, -4.67047470e-03],
[ -2.07206006e-03, 6.60686763e-04, 2.04637699e-03, ...,
7.94521155e-03, 1.50024315e-02, -4.88461803e-03],
[ 1.43106607e-03, -1.77342544e-03, 4.57835186e-05, ...,
5.55311541e-03, 1.61148688e-02, -4.63583610e-03]]))
Is there any way to do it?
Thank you
