I have a dataframe that looks like this:
| A | B | C | D
0 | a | b | c | d | e | f | g | h
1 | a | b | c | d | e | f | NaN | NaN
2 | a | b | NaN | NaN | e | f | NaN | NaN
3 | a | b | NaN | NaN | NaN | NaN | NaN | NaN
and I want to change it to this:
OBJ VAL1 VAL2
0 A a b
1 A a b
2 A a b
3 A a b
4 A a b
5 A a b
6 B c d
7 B c d
8 C e f
9 C e f
10 C e f
11 D g h
so the multindex will convert to a column as well.
any help please?
and is there any good tutorial that explains exactly those kind of stuff so I will be able to do it and not just try and error?
Thank you
EDIT: My first originally dataframe looks like this:
A B C D
0 (a,b) (c,d) (e,f) (g,h)
1 (a,b) (c,d) (e,f) NaN
2 (a,b) NaN (e,f) NaN
3 (a,b) NaN NaN NaN
so in each cell there is a tuple.