I have a dictionary as follows
pj = {'S_P': 42.0, 'S_SB': 30.0, 'C_G': 17.0, 'T_G': 25.0, 'C_O': 34.0, 'C_P': 39.0, 'C_SB': 20.0, 'T_O': 39.0}
i want to arrange this dictionary as i.e in ascending order
pj = {'C_G': 17.0, 'C_SB': 20.0,'T_G': 25.0,'S_SB': 30.0,'C_O': 34.0,'C_P': 39.0, , 'T_O': 39.0 ,'S_P': 42.0}
To achieve this what can i do
i have tried using
print sorted(pj.values())
but i get output as
[17.0, 20.0, 25.0, 30.0, 34.0, 39.0, 39.0, 42.0]
I am using python 2.7