So I got a dataframe that looks like this: Original DataFrame
df = pd.DataFrame({'0': ['a', 'b', 'c', 'd'],
'1': [123,145,293,403],
'2': [402,103,242,757],
'3': [3.121,4.55,0,9.32],
'4': ['3T', '4B', '400B', '400T']})
and I need to transform that DataFrame so it looks something like this:
| a_1 | a_2 | a_3 | a_4 | b_1 | b_2 | b_3 | b_4 | ... |
|---|---|---|---|---|---|---|---|---|
| 123 | 402 | 3.121 | 3T | 145 | 103 | 4.555 | 4B | ... |
Anyone knows how to do it with pandas?