I have a variable called 'Specimen' from a dataframe imported from a xlsx file, and I want to implement the result of this variable (in this case 25) in a new dataframe?
What I have:
Specimen = np.array(df.loc['Specimen', ['x1']])
Specimen
array([[25.0]], dtype=object)
New_Df = pd.DataFrame(Variable_list)
New_Df['Result_list'] = Result_list
New_Df.columns =['Name', 'Result']
New_Df
Name Result
0 L_TotalNOT 52.541091
1 R_TotalNOT 40.139543
2 L_TotalGON 59.271545
3 R_TotalGON 63.784038
What I want:
25 Name Result
0 L_TotalNOT 52.541091
1 R_TotalNOT 40.139543
2 L_TotalGON 59.271545
3 R_TotalGON 63.784038
I have tried
Output.index.names = [Specimen]
But this gives the following error: TypeError: RangeIndex.name must be a hashable type
ps: I'm quite new here, so I hope I'm asking thing the right way, Many thanks in advance