Pandas Rename Index Values

I have the following data file in pandas (python):

BXY A alpha 3. 5. 5 beta 9. 9. 11 

I want to change the 'alpha' for another name, for example 'mu'. What should I do?

+5
source share
1 answer

Use rename with index parameter
pass the dictionary to the index parameter

 df.rename(index={'alpha': 'mu'}) 

enter image description here

+8
source

Source: https://habr.com/ru/post/1260479/


All Articles