0

I have a pandas dataframe of the form:

   Experiment1  Experiment2  Experiment3  Experiment4 ... ExperimentN
0  39.051650    27.681186    32.278991     31.383350  ...  31.383350
1  39.051650    27.681186    32.278991     31.383350  ...  31.383350
2  39.051650    27.681186    32.278991     31.383350  ...  31.383350
3  39.051650    27.681186    32.278991     31.383350  ...  31.383350
4  39.051650    27.681186    32.278991     31.383350  ...  31.383350
5  39.051650    27.681186    32.278991     31.383350  ...  31.383350
6  39.051650    27.681186    32.278991     31.383350  ...  31.383350

Numbers are just placeholders, experiments won't have all constant values in practice. Instead of an independent column for each experiment, I want the column headers to be identifiers in their own "Experiment" column, and to take all the data and place it into one column:

     Experiment     Values
0   "Experiment1"  39.051650
1   "Experiment1"  39.051650
.         .            .
.         .            .
.         .            .
N-1 "ExperimentN"  31.383350
N   "ExperimentN"  31.383350

How would I go about doing this?

PedsB
  • 311
  • 2
  • 9

0 Answers0