Is there a way to reshape DataFrame to another with unrestricted rows. I just want a DataFrame with 3 columns, no matter how many rows is going to be in DataFrame?
For example,
letters = pd.DataFrame({'Letters' : ['A', 'B', 'C','D', 'E', 'F', 'G', 'H',
'I','J']})
Letters
0 A
1 B
2 C
3 D
4 E
5 F
6 G
7 H
8 I
9 J
and I want to reshape it like this with filling zeroes, where there is no value.
first second third
A B C
D E F
G H I
J 0 0
In numpy reshape method as far as I know you need to explicitly identify, how much columns and rows you want..
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…