码迷,mamicode.com
首页 > 编程语言 > 详细

python list按 两个字段排序

时间:2021-04-15 12:00:42      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:pytho   none   字段   字段排序   code   one   isp   col   ring   

 
[
    {
      "m": "01",
      "v": 0.019,
      "dq": 0,
      "ts": null,
      "pf": null,
      "time": "2021-03-28 00:00:00",
      "stringTime": "2021-03-28",
      "flag": null
    },
    {
      "m": "01",
      "v": 0.019799999999999998,
      "dq": 0,
      "ts": null,
      "pf": null,
      "time": "2021-03-31 00:00:00",
      "stringTime": "2021-03-31",
      "flag": null
    },
    {
      "m": "01",
      "v": 0.0203,
      "dq": 0,
      "ts": null,
      "pf": null,
      "time": "2021-03-07 00:00:00",
      "stringTime": "2021-03-07",
      "flag": null
    },
    {
      "m": "01",
      "v": 0.022099999999999998,
      "dq": 0,
      "ts": null,
      "pf": null,
      "time": "2021-03-25 00:00:00",
      "stringTime": "2021-03-25",
      "flag": null
    },
    {
      "m": "01",
      "v": 0.021599999999999998,
      "dq": 0,
      "ts": null,
      "pf": null,
      "time": "2021-03-27 00:00:00",
      "stringTime": "2021-03-27",
      "flag": null
    },
    {
      "m": "01",
      "v": 0.0202,
      "dq": 0,
      "ts": null,
      "pf": null,
      "time": "2021-03-19 00:00:00",
      "stringTime": "2021-03-19",
      "flag": null
    },
    {
      "m": "01",
      "v": 0.0207,
      "dq": 0,
      "ts": null,
      "pf": null,
      "time": "2021-03-11 00:00:00",
      "stringTime": "2021-03-11",
      "flag": null
    },
    {
      "m": "01",
      "v": 0.022,
      "dq": 0,
      "ts": null,
      "pf": null,
      "time": "2021-03-17 00:00:00",
      "stringTime": "2021-03-17",
      "flag": null
    }]

先按time排序,再按m排序。

python list按 两个字段排序

标签:pytho   none   字段   字段排序   code   one   isp   col   ring   

原文地址:https://www.cnblogs.com/yoyoma0355/p/14657008.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!