I currently have a data frame that looks like this
Temp1 Temp2 Pattern Errors
307.858K 303.197K F0's 0
297.960K 282.329K F1's 0
277K 260K CA 0
262K 238K C5 0
228K 168K DATA==ADDR 0
192K 140K PRBS 0
197K 77K F0's 0
199.9K 77.3K F1's 0
199K 773K CA 0
C5 0
DATA==ADDR 0
PRBS 0
F0's 0
F1's 0
CA 0
C5 0
DATA==ADDR 0
PRBS 0
F0's 0
F1's 0
CA 0
C5 0
DATA==ADDR 0
PRBS 0
. .
. .
. .
Expected output table
Temp1 Temp2 Pattern Errors
F0's 0
F1's 0
CA 0
C5 0
DATA==ADDR 0
PRBS 0
307.858K 303.197K F0's 0
F1's 0
CA 0
C5 0
DATA==ADDR 0
PRBS 0
297.960K 282.329K F0's 0
F1's 0
CA 0
C5 0
DATA==ADDR 0
PRBS 0
277K 260K F0's 0
F1's 0
CA 0
C5 0
DATA==ADDR 0
PRBS 0
262K 238K . .
. .
. .
I want to change it to where the temperature column is split up to have a value for each section. ie. the first 2 temperature values correspond to the values from the second F0's to PRBS, then the second 2 temperature values correspond to the next set of 6 patterns. I thought the best way to do this would be adding 6 blank spaces before each entry but I don't know if that is the best way to do it and if it is, I'm not really sure how to go around doing it, any help will be appreciated.
EDIT: This data frame is created by concatenating 3 different dataframes I created earlier by parsing through a log file.
results = pd.concat([tempFrame, patternFrame, errorsFrame], axis = 1, sort = False)
The tempFrame contains the first 2 columns, the patternFrame contains the Pattern column and errorsFrame contains the Errors column.
tempFrame:
tempFrame = tempFrame.assign(newIndex = tempFrame.groupby('Extra').cumcount())
tempFrame= tempFrame.set_index(['newIndex', 'Extra']).unstack().swaplevel(0, axis = 1).sort_index(axis = 1, level = 0)