I have a dataframe:
Form nr Element Type Text Options
1 Name1 select text1 op1
1 Name1 select text op2
1 Name1 select text op3
1 Name2 input text2 NaN
2 Name1 input text2 NaN
Is there a way to greate a “nested” hierarchical index like this:
Form nr Element Type Text Options
1 Name1 select text1 op1
op2
op3
Name2 input text2 NaN
2 Name1 input text2 NaN
Assuming there is a typo in the Text column, text <-> text1?
I`ll go from your first DataFrame.