I am looking for the simplest solution to create a Python data frame from a CSV file that has duplicate index names (s1 and s2 in the example below).
Here is how the CSV file looks like:
var1 var2 var3
unit x 8 4 12
temp y -1 -4 -3
time
s1 9 12 11
s2 12 15 7
month
s1 1 3 12
s2 2 4 6
Python data frame should be as follows:
var1 var2 var3
unit x 8 4 12
temp y -1 -4 -3
time s1 9 12 11
time s2 12 15 7
month s1 1 3 12
month s2 2 4 6
What's the best way to perform this operation?