I have this Dataframe:
Dataframe
import pandas as pd df = pd.DataFrame({\'Hugo\' : {\'age\' : 21, \'weight\' : 75}, \'Bertram\': {\'age\' :
The below is the most efficient since it appends the new index of age and makes sure its inplace
age
df.set_index('age',append=True,inplace=True)