我需要用以下形状reshape 数据帧:
sample_df
Out[97]:
0 1 2 3
0 2011-01-01 00:00:00 123.39 2012-01-01 00:00:00 123.4
1 2011-01-01 01:00:00 123.39 2012-01-01 01:00:00 123.38
2 2011-01-01 02:00:00 123.4 2012-01-01 02:00:00 123.4
3 2011-01-01 03:00:00 123.4 2012-01-01 03:00:00 123.4
4 2011-01-01 04:00:00 123.41 2012-01-01 04:00:00 123.4
形状如下:
reshaped_sample_df
Out[97]:
0 1
0 2011-01-01 00:00:00 123.39
1 2011-01-01 01:00:00 123.39
2 2011-01-01 02:00:00 123.4
3 2011-01-01 03:00:00 123.4
4 2011-01-01 04:00:00 123.41
5 2012-01-01 00:00:00 123.4
6 2012-01-01 01:00:00 123.38
7 2012-01-01 02:00:00 123.4
8 2012-01-01 03:00:00 123.4
9 2012-01-01 04:00:00 123.4
我一直在努力reshape Pandas 的数据功能,但并没有成功.