可能这是重复的。我没有找到相同类型的问题 我有一个字典列表,例如
mylist=[
{'month':'MAR2011','amount':90},
{'month':'MAR2013','amount':190},
{'month':'JUN2011','amount':290},
{'month':'AUG2011','amount':930},
{'month':'DEC2011','amount':30},
{'month':'NOV2010','amount':40},
{'month':'FEB 2013','amount':760},
{'month':'SEP 2012','amount':330},
{'month':'APR2013','amount':50},
{'month':'NOV 2011','amount':450},
{'month':'OCT 2012','amount':450},
]
我想得到这样的输出:
[
{'month':'FEB 2013','amount':760},
{'month':'MAR2011','amount':90},
{'month':'MAR2013','amount':190},
{'month':'APR 2013','amount':50},
{'month':'JUN2011','amount':290},
{'month':'AUG2011','amount':930},
{'month':'SEP 2012','amount':330},
{'month':'OCT 2012','amount':450},
{'month':'NOV2010','amount':40},
{'month':'NOV 2011','amount':450},
{'month':'DEC2011','amount':30},
]
不想考虑年份。按月份排序。
提前致谢