I am in the process of creating a python script that extracts data from a poorly designed output file (which I can't change) from a piece of equipment within our research lab. I would like to include a way to iteratively combine the text in the first column of a dataframe (example below) with each other column in the dataframe.
A simple example of the dataframe:
Filename | 1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|
a | Sheet(1) | Sheet(2) | Sheet(3) | Sheet(4) | .... |
b | Sheet(1) | Sheet(2) | -------- | -------- | .... |
c | Sheet(1) | Sheet(2) | Sheet(3) | Sheet(4) | .... |
d | Sheet(1) | Sheet(2) | Sheet(3) | -------- | .... |
e | Sheet(1) | Sheet(2) | Sheet(3) | Sheet(4) | .... |
f | Sheet(1) | -------- | -------- | -------- | .... |
What I am looking to produce:
Filename | 1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|
a | a_Sheet(1) | a_Sheet(2) | a_Sheet(3) | a_Sheet(4) | .... |
b | b_Sheet(1) | b_Sheet(2) | -------- | -------- | .... |
c | c_Sheet(1) | c_Sheet(2) | c_Sheet(3) | c_Sheet(4) | .... |
d | d_Sheet(1) | d_Sheet(2) | d_Sheet(3) | -------- | .... |
e | e_Sheet(1) | e_Sheet(2) | e_Sheet(3) | e_Sheet(4) | .... |
f | f_Sheet(1) | -------- | -------- | -------- | .... |