Let's say I have this data set and for analysing the trends between male and female literacy across rural and urban region of every state . I need to set index as Name
Which I can do as -
df.set_index('Name',inplace=True)
Now I want to segregate my data into Rural and Urban
And expect the ouput as -
How can I acheive this ?
EDIT: I tried doing it using groupby
Literacy_States=Literacy_States.groupby(['Name','TRU'])['M_LIT','F_LIT'].count().unstack('TRU').plot.bar()