I am new to [pandas](https://pandas.pydata.org/) and working with [DataFrames](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html). I'm looking at the documentation for [Merge,Join,Concatenate](https://pandas.pydata.org/pandas-docs/stable/merging.html), and it's probably staring me right in the face, but I'm still having trouble transposing the data the way I need it.

I have data that looks like this ( R rows x 4302 columns ):

```
| w:350 |       r:350 | w:351 |   r:351 |  ...  | w:2499 |      r:2499 | w:2500 |  r:2500 |
-------------------------------------------------------------------------------------------
|   350 | -3.0998e-04 |   351 |  0.0001 |  ...  |   2499 | -3.6000e-05 |   2500 |  0.0004 |
|   350 | -1.8316e-03 |   351 | -0.0008 |  ...  |   2499 | -3.1124e-04 |   2500 | -0.0004 |
|   350 | -1.0520e-03 |   351 | -0.0014 |  ...  |   2499 |  4.0166e-04 |   2500 |  0.0012 |
|   350 | -3.4060e-04 |   351 |  0.0006 |  ...  |   2499 |  1.2782e-03 |   2500 |  0.0012 |

```

That I want to look like this ( X rows x 2 columns ):

```
|     x |           y |
-----------------------
|   350 | -3.0998e-04 |
|   350 | -1.8316e-03 |
|   350 | -1.0520e-03 |
|   350 | -3.4060e-04 |
|   351 |      0.0001 |
|   351 |     -0.0008 |
|   351 |     -0.0014 |
|   351 |      0.0006 |
...
|  2499 | -3.6000e-05 |
|  2499 | -3.1124e-04 |
|  2499 |  4.0166e-04 |
|  2499 |  1.2782e-03 |
|  2500 |      0.0004 |
|  2500 |     -0.0004 |
|  2500 |      0.0012 |
|  2500 |      0.0012 |

```

I guess you can think of it as a DataFrame of rows of multiple sets of x,y data, that I want combined into a DataFrame of rows of a single set of x,y data. Or in other words, each row is currently a graph of x,y data. And I need a single collection of x,y data of all the graphs.

I've tried this, but it's not working (probably because the column names not named the same). It's also probably not the most efficient way to do what I'm trying to do. Here `output` is my original data, and `outputxy` is the transposed data that I want.

```
outputxy = pandas.DataFrame()
for i in range(0, len(output.columns), 2):
    outputxy = pandas.concat([output.iloc[:, i:i+2], outputxy])

```

Thank you in advance for any help!