I need help in reshaping a data in csv file that have over 10000 row by 10 each. For example I have this csv file :
Ale Brick 1 ww 2 ee 3 qq 3 xx 5 dd
You can group by every 10th row and then reshape the values
df.groupby(np.repeat(np.arange(len(df) / 10), 10))['Brick'].apply(lambda x: x.values.reshape(2,5)) 0.0 [[ww, ee, qq, xx, dd], [gg, hh, tt, yy, uu]] 1.0 [[ii, oo, pp, mm, ww], [zz, cc, rr, tt, ll]]