I have a text file with my data, formatted as a single list. The data is actually a number of rows and columns, but the format is as a single column. I have imported this into a pandas dataframe, and I would like to reshape this dataframe.
This is the format of the data as a list:
a1
b1
c1
d1
e1
a2
b2
c2
d2
e2
a3
b3
c3
d3
e3
etc...
The desired format is:
"Heading 1" "Heading 2" "Heading 3" "Heading 4" "Heading 5"
a1 b1 c1 d1 e1
a2 b2 c2 d2 e2
a3 b3 c3 d3 e3
I have tried pandas stack and unstack functions, but no luck. I had also tried using a numpy array, but my data has numbers and strings in it, so this does not work well.