I have the current dataframe and I want to set the index to Id
and GroupNumber
and have them as a unique value in the Index. However, when I set the index the last index still gets duplicated (GroupNumber in my case).
df = pd.DataFrame({'Id':['A','A','A','A','A'],
'GroupNumber': [5,5,5,5,5],
'Name': ['John','Paul','George','Anthony','David'],
'Weight':['Average','Below Average','Above Average','Average','Above Average'],
'Height':['Tall','Short','Average','Tall','Average']})
df = df.set_index(['Id','GroupNumber'])
Desired Output:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…