df = pd.DataFrame(np.arange(8).reshape(4, 2), index=['a_1', 'b_2', 'c_3',
    'c_4'])
print(df)
index = pd.MultiIndex.from_tuples([item.split('_') for item in df.index])
df.index = index
print(df)
rename index of a pandas dataframe