I am trying to figure out how to make columns out of arrays within an array. I am trying to save these columns to a text file.
I have tried multiple things, but I don't get columns. I get a large array that is going vertically down.
a = [[array([ 2.05096059, 3.65564871, 0.25845727, 2.86561982, 1.45278606]),
array([5,10,15,20,25)]),
array([10,11,12,13,14])]
This is what I have tried, but it doesn't work.
for column in np.transpose(C):
C_arr = np.hstack(column)
# j = int(k)-1
C_Values[j].append(C_arr)
I expect that I should get five columns with three elements in each column.
Expected output:
2.05096059 3.65564871 0.25845727 2.86561982 1.45278606
5 10 15 20 25
10 11 12 13 14
aas shown looks like a list (object dtype) containing 3 arrays (ndarray).np.transpose(C)will turn that into a (3,5) array (float dtype) and then (5,3). Eachcolumnwill be a (5,) shape array. What's wrong withC_Values?dtype).