What is the right way of repeating columns in DataFrame?
I'm working on df:
England Germany US
0 -3.3199 -3.31 496.68
1 1004.0 4.01 4.01
2 4.9794 4.97 1504.97
3 3.1766 2003.17 3.17
And I'd like to obtain:
England England Germany Germany US US
0 -3.3199 -3.3199 -3.31 -3.31 496.68 496.68
1 1004.0 1004.0 4.01 4.01 4.01 4.01
2 4.9794 4.9794 4.97 4.97 1504.97 1504.97
3 3.1766 3.1766 2003.17 2003.17 3.17 3.17
I tough of getting headers from the original DataFrame and double them:
headers_double = [x for x in headers for i in range(2)]
Subsequently I tried to create df with new headers:
df.columns = [x for x in headers_double]
Unfortunately, my way of thinking was wrong. Any suggestions how to solve this problem?