The columns in my dataframe contain tuples and empty cells. The number of columns in the dataframe is dynamic and the columns have no lables.
**0 1 2**
**0** name,score,ID name,score,ID None
**1** name,score,ID None None
**2** None None name,score,ID
I want to split the tuples of all columns in separate columns, i.e:
**Name0 Score0 ID0 Name1 Score1 ID1 Name2 Score2 ID2**
**0** name score ID name score ID None None None
**1** name score ID None None None None None None
**2** None None None None None None name score ID
I found the following:
df1[['Name', 'Score', "ID"]] = pd.DataFrame(df1[0].tolist(), index=df1.index)
which works basically, however it just splits the first columns tuples into separate columns (--> df1[0]). I cant find how to apply this to all columns tuples.
Any help appreciated!