Using Python 3.6, I have the results of a text reader that gives me repeating lines like this:
df
Col 1
0 Text A1
1 Text B1
2 Text C1
3 Text D1
4 Text E1
5 Text A2
6 Text B2
7 Text C2
8 Text D2
9 Text E2
10 Text A3
11 Text B3
12 Text C3
13 Text D3
14 Text E3
- * Added edit: Some of the above texts are blanks. There are no commas that I can do a str.split() and I'm not sure reshaping is the right way to go. The information repeats every 5 entries and I'm trying to separate them into columns so that it looks like:
Col1 Col2 Col3 Col4 Col5
0 Text A1 Text B1 Text C1 Text D1 Text E1
1 Text A2 Text B2 Text C2 Text D2 Text E2
2 Text A3 Text B3 Text C3 Text D3 Text E3
What is the pythonic way to reshape or split into 5 columns not relying on punctuation from the text?