I need to reshape a DataFrame with the following shape:
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
Into the following shape:
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
I've been struggling with plenty of the reshaping data functions in Pandas but without success.