I would like to add a column to a dataframe between two columns in number labeled columns dataframe. In the following dataframe the first column corresponds to the index while the first row to the name of the columns.
df
0 0 1 2 3 4 5
1 6 7 4 5 2 1
2 0 3 1 3 3 4
3 9 8 4 3 6 2
I have tmp=[2,3,5]
that I want to put between the columns 4
and 5
, so
df
0 0 1 2 3 4 5 6
1 6 7 4 5 2 2 1
2 0 3 1 3 3 3 4
3 9 8 4 3 6 5 2