python list按 两个字段排序

2021-06-04 12:03

阅读:430

标签: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


评论


亲,登录后才可以留言!