I have a data table with a dimension of 214 rows and 972 columns.
I want to pick up every 108 columns and then flatten into one column.
Then the output table would have a dimension of 23112 (=214*108) rows and 9 columns.
I have tried pd.concat and pd.flatten something etc.,,,, but I can only flatten whole columns of table into one column.
So to be simple, below is the toy table. Pick up every two columns and flatten them into one column. so I want to reshape; [ 5*6 ] to [ 10*3 ]
a b c d e f
g h i j k l
m n o p q r
s t u v w x
y z 1 2 3 4
This would be converted to
a c e
g i k
m o q
s u w
y 1 3
b d f
h j l
n p r
t v x
z 2 4
I am really new to python,,,, too hard to figure it out,, Thank you for your help!