- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我对编码非常陌生,我想将深层嵌套的 JSON 文件转换为 CSV。我知道这可以通过 pandas 模块轻松实现。
我尝试使用 pandas 包并将标准化部分输出到 cvs 中。
{"status": "success", "data": {"metrics": {"mid1": {"did1": {"id": "did1", "data": [{"t": "2019-02-07T08:00:00.000Z", "v_amm": 0.32}, {"t": "2019-02-07T09:00:00.000Z", "v_amm": 0.3228888889}, {"t": "2019-02-07T10:00:00.000Z", "v_amm": 0.209375}, {"t": "2019-02-07T11:00:00.000Z", "v_amm": 0.1672}, {"t": "2019-02-07T12:00:00.000Z", "v_amm": 0.1962790698}, {"t": "2019-02-07T13:00:00.000Z", "v_amm": 0.3023529412}, {"t": "2019-02-07T14:00:00.000Z", "v_amm": 0.3298}, {"t": "2019-02-07T15:00:00.000Z", "v_amm": 0.324893617}, {"t": "2019-02-07T16:00:00.000Z", "v_amm": 0.5273469388}, {"t": "2019-02-07T17:00:00.000Z", "v_amm": 0.5739583333}, {"t": "2019-02-07T18:00:00.000Z", "v_amm": 0.5211363636}, {"t": "2019-02-07T19:00:00.000Z", "v_amm": 0.3131111111}, {"t": "2019-02-07T20:00:00.000Z", "v_amm": 0.2702173913}, {"t": "2019-02-07T21:00:00.000Z", "v_amm": 0.243877551}, {"t": "2019-02-07T22:00:00.000Z", "v_amm": 0.2474}, {"t": "2019-02-07T23:00:00.000Z", "v_amm": 0.2822222222}, {"t": "2019-02-08T00:00:00.000Z", "v_amm": 0.2879166667}, {"t": "2019-02-08T01:00:00.000Z", "v_amm": 0.3117021277}, {"t": "2019-02-08T02:00:00.000Z", "v_amm": 0.2834}, {"t": "2019-02-08T03:00:00.000Z", "v_amm": 0.2708}, {"t": "2019-02-08T04:00:00.000Z", "v_amm": 0.2275}, {"t": "2019-02-08T05:00:00.000Z", "v_amm": 0.26325}, {"t": "2019-02-08T06:00:00.000Z", "v_amm": 0.3016666667}, {"t": "2019-02-08T07:00:00.000Z", "v_amm": 0.2802702703}, {"t": "2019-02-08T08:00:00.000Z", "v_amm": 0.5284615385}, {"t": "2019-02-08T09:00:00.000Z", "v_amm": 0.4132653061}, {"t": "2019-02-08T10:00:00.000Z", "v_amm": 0.2310638298}, {"t": "2019-02-08T11:00:00.000Z", "v_amm": 0.2582978723}, {"t": "2019-02-08T12:00:00.000Z", "v_amm": 0.2257777778}, {"t": "2019-02-08T13:00:00.000Z", "v_amm": 0.23}, {"t": "2019-02-08T14:00:00.000Z", "v_amm": 0.2432}, {"t": "2019-02-08T15:00:00.000Z", "v_amm": 0.3872727273}, {"t": "2019-02-08T16:00:00.000Z", "v_amm": 0.690952381}, {"t": "2019-02-08T17:00:00.000Z", "v_amm": 0.4112820513}, {"t": "2019-02-08T18:00:00.000Z", "v_amm": 0.3334042553}, {"t": "2019-02-08T19:00:00.000Z", "v_amm": 0.3138095238}, {"t": "2019-02-08T20:00:00.000Z", "v_amm": 0.2822916667}, {"t": "2019-02-08T21:00:00.000Z", "v_amm": 0.2975510204}, {"t": "2019-02-08T22:00:00.000Z", "v_amm": 0.3173913043}, {"t": "2019-02-08T23:00:00.000Z", "v_amm": 0.2622}, {"t": "2019-02-09T00:00:00.000Z", "v_amm": 0.2725}, {"t": "2019-02-09T01:00:00.000Z", "v_amm": 0.3025}, {"t": "2019-02-09T02:00:00.000Z", "v_amm": 0.3009615385}, {"t": "2019-02-09T03:00:00.000Z", "v_amm": 0.2767391304}, {"t": "2019-02-09T04:00:00.000Z", "v_amm": 0.2729268293}, {"t": "2019-02-09T05:00:00.000Z", "v_amm": 0.2337254902}, {"t": "2019-02-09T06:00:00.000Z", "v_amm": 0.2195744681}, {"t": "2019-02-09T07:00:00.000Z", "v_amm": 0.2669565217}, {"t": "2019-02-09T08:00:00.000Z", "v_amm": 0.4612}, {"t": "2019-02-09T09:00:00.000Z", "v_amm": 0.4528}, {"t": "2019-02-09T10:00:00.000Z", "v_amm": 0.7535}, {"t": "2019-02-09T11:00:00.000Z", "v_amm": 0.6319565217}, {"t": "2019-02-09T12:00:00.000Z", "v_amm": 0.4233333333}, {"t": "2019-02-09T13:00:00.000Z", "v_amm": 0.4465306122}, {"t": "2019-02-09T14:00:00.000Z", "v_amm": 0.4646808511}, {"t": "2019-02-09T15:00:00.000Z", "v_amm": 0.9197916667}, {"t": "2019-02-09T16:00:00.000Z", "v_amm": 0.8802272727}, {"t": "2019-02-09T17:00:00.000Z", "v_amm": 0.495}, {"t": "2019-02-09T18:00:00.000Z", "v_amm": 0.5051020408}, {"t": "2019-02-09T19:00:00.000Z", "v_amm": 0.4255102041}, {"t": "2019-02-09T20:00:00.000Z", "v_amm": 0.3834090909}, {"t": "2019-02-09T21:00:00.000Z", "v_amm": 0.3304761905}, {"t": "2019-02-09T22:00:00.000Z", "v_amm": 0.3488235294}, {"t": "2019-02-09T23:00:00.000Z", "v_amm": 0.3827083333}, {"t": "2019-02-10T00:00:00.000Z", "v_amm": 0.3683333333}, {"t": "2019-02-10T01:00:00.000Z", "v_amm": 0.2956818182}, {"t": "2019-02-10T02:00:00.000Z", "v_amm": 0.2761702128}, {"t": "2019-02-10T03:00:00.000Z", "v_amm": 0.2614}, {"t": "2019-02-10T04:00:00.000Z", "v_amm": 0.2495833333}, {"t": "2019-02-10T05:00:00.000Z", "v_amm": 0.253255814}, {"t": "2019-02-10T06:00:00.000Z", "v_amm": 0.24}, {"t": "2019-02-10T07:00:00.000Z", "v_amm": 0.2276595745}, {"t": "2019-02-10T08:00:00.000Z", "v_amm": 0.6124489796}, {"t": "2019-02-10T09:00:00.000Z", "v_amm": 0.3348837209}, {"t": "2019-02-10T10:00:00.000Z", "v_amm": 0.4641176471}, {"t": "2019-02-10T11:00:00.000Z", "v_amm": 0.5104651163}, {"t": "2019-02-10T12:00:00.000Z", "v_amm": 0.6389583333}, {"t": "2019-02-10T13:00:00.000Z", "v_amm": 0.5759090909}, {"t": "2019-02-10T14:00:00.000Z", "v_amm": 0.3966666667}, {"t": "2019-02-10T15:00:00.000Z", "v_amm": 0.2819148936}, {"t": "2019-02-10T16:00:00.000Z", "v_amm": 0.4406122449}, {"t": "2019-02-10T17:00:00.000Z", "v_amm": 0.5102173913}, {"t": "2019-02-10T18:00:00.000Z", "v_amm": 0.9091489362}, {"t": "2019-02-10T19:00:00.000Z", "v_amm": 1.0484}, {"t": "2019-02-10T20:00:00.000Z", "v_amm": 0.8555319149}, {"t": "2019-02-10T21:00:00.000Z", "v_amm": 0.6444230769}, {"t": "2019-02-10T22:00:00.000Z", "v_amm": 0.5922}, {"t": "2019-02-10T23:00:00.000Z", "v_amm": 0.4859183673}, {"t": "2019-02-11T00:00:00.000Z", "v_amm": 0.4322222222}, {"t": "2019-02-11T01:00:00.000Z", "v_amm": 0.371025641}, {"t": "2019-02-11T02:00:00.000Z", "v_amm": null}, {"t": "2019-02-11T03:00:00.000Z", "v_amm": 0.25}, {"t": "2019-02-11T04:00:00.000Z", "v_amm": 0.22}, {"t": "2019-02-11T05:00:00.000Z", "v_amm": 0.1952631579}, {"t": "2019-02-11T06:00:00.000Z", "v_amm": 0.224047619}, {"t": "2019-02-11T07:00:00.000Z", "v_amm": 0.2126}, {"t": "2019-02-11T08:00:00.000Z", "v_amm": 1.3086956522}, {"t": "2019-02-11T09:00:00.000Z", "v_amm": 0.5789795918}, {"t": "2019-02-11T10:00:00.000Z", "v_amm": 0.4882608696}, {"t": "2019-02-11T11:00:00.000Z", "v_amm": 0.2674468085}, {"t": "2019-02-11T12:00:00.000Z", "v_amm": 0.4987804878}, {"t": "2019-02-11T13:00:00.000Z", "v_amm": 0.5289795918}, {"t": "2019-02-11T14:00:00.000Z", "v_amm": 0.3173469388}, {"t": "2019-02-11T15:00:00.000Z", "v_amm": 0.4991836735}, {"t": "2019-02-11T16:00:00.000Z", "v_amm": 0.2706382979}, {"t": "2019-02-11T17:00:00.000Z", "v_amm": 0.3434782609}, {"t": "2019-02-11T18:00:00.000Z", "v_amm": 0.315}, {"t": "2019-02-11T19:00:00.000Z", "v_amm": 0.2244897959}, {"t": "2019-02-11T20:00:00.000Z", "v_amm": 0.6378}, {"t": "2019-02-11T21:00:00.000Z", "v_amm": 0.487}, {"t": "2019-02-11T22:00:00.000Z", "v_amm": 0.3019565217}, {"t": "2019-02-11T23:00:00.000Z", "v_amm": 0.1968085106}, {"t": "2019-02-12T00:00:00.000Z", "v_amm": 0.1647619048}, {"t": "2019-02-12T01:00:00.000Z", "v_amm": 0.1795744681}, {"t": "2019-02-12T02:00:00.000Z", "v_amm": 0.1664444444}, {"t": "2019-02-12T03:00:00.000Z", "v_amm": 0.1862790698}, {"t": "2019-02-12T04:00:00.000Z", "v_amm": 0.1721428571}, {"t": "2019-02-12T05:00:00.000Z", "v_amm": 0.1628888889}, {"t": "2019-02-12T06:00:00.000Z", "v_amm": 0.1854166667}, {"t": "2019-02-12T07:00:00.000Z", "v_amm": 0.2134782609}, {"t": "2019-02-12T08:00:00.000Z", "v_amm": 1.1947916667}, {"t": "2019-02-12T09:00:00.000Z", "v_amm": 0.327826087}, {"t": "2019-02-12T10:00:00.000Z", "v_amm": 0.2295238095}, {"t": "2019-02-12T11:00:00.000Z", "v_amm": 0.2482}, {"t": "2019-02-12T12:00:00.000Z", "v_amm": 0.2009302326}, {"t": "2019-02-12T13:00:00.000Z", "v_amm": 0.2583333333}, {"t": "2019-02-12T14:00:00.000Z", "v_amm": 0.2688372093}, {"t": "2019-02-12T15:00:00.000Z", "v_amm": 0.2929545455}, {"t": "2019-02-12T16:00:00.000Z", "v_amm": 0.434375}, {"t": "2019-02-12T17:00:00.000Z", "v_amm": 0.3604255319}, {"t": "2019-02-12T18:00:00.000Z", "v_amm": 0.2995652174}, {"t": "2019-02-12T19:00:00.000Z", "v_amm": 0.3121276596}, {"t": "2019-02-12T20:00:00.000Z", "v_amm": 0.2925531915}, {"t": "2019-02-12T21:00:00.000Z", "v_amm": 0.2760416667}, {"t": "2019-02-12T22:00:00.000Z", "v_amm": 0.269375}, {"t": "2019-02-12T23:00:00.000Z", "v_amm": 0.2435714286}, {"t": "2019-02-13T00:00:00.000Z", "v_amm": 0.2360416667}, {"t": "2019-02-13T01:00:00.000Z", "v_amm": 0.2238095238}, {"t": "2019-02-13T02:00:00.000Z", "v_amm": 0.242}, {"t": "2019-02-13T03:00:00.000Z", "v_amm": 0.2191666667}, {"t": "2019-02-13T04:00:00.000Z", "v_amm": 0.1875555556}, {"t": "2019-02-13T05:00:00.000Z", "v_amm": 0.1870833333}, {"t": "2019-02-13T06:00:00.000Z", "v_amm": 0.1866666667}, {"t": "2019-02-13T07:00:00.000Z", "v_amm": 0.2014634146}, {"t": "2019-02-13T08:00:00.000Z", "v_amm": 0.4024489796}, {"t": "2019-02-13T09:00:00.000Z", "v_amm": 0.3254545455}, {"t": "2019-02-13T10:00:00.000Z", "v_amm": 0.2670212766}, {"t": "2019-02-13T11:00:00.000Z", "v_amm": 0.2891111111}, {"t": "2019-02-13T12:00:00.000Z", "v_amm": 0.3076086957}, {"t": "2019-02-13T13:00:00.000Z", "v_amm": 0.3214285714}, {"t": "2019-02-13T14:00:00.000Z", "v_amm": 0.3970212766}, {"t": "2019-02-13T15:00:00.000Z", "v_amm": 0.3094117647}, {"t": "2019-02-13T16:00:00.000Z", "v_amm": 0.4798039216}, {"t": "2019-02-13T17:00:00.000Z", "v_amm": 0.6639583333}, {"t": "2019-02-13T18:00:00.000Z", "v_amm": 0.3802083333}, {"t": "2019-02-13T19:00:00.000Z", "v_amm": 0.3154901961}, {"t": "2019-02-13T20:00:00.000Z", "v_amm": 0.2916326531}, {"t": "2019-02-13T21:00:00.000Z", "v_amm": 0.2527272727}, {"t": "2019-02-13T22:00:00.000Z", "v_amm": 0.3126666667}, {"t": "2019-02-13T23:00:00.000Z", "v_amm": 0.3048}, {"t": "2019-02-14T00:00:00.000Z", "v_amm": 0.3066}, {"t": "2019-02-14T01:00:00.000Z", "v_amm": 0.3171428571}, {"t": "2019-02-14T02:00:00.000Z", "v_amm": 0.2978947368}, {"t": "2019-02-14T03:00:00.000Z", "v_amm": 0.3557142857}, {"t": "2019-02-14T04:00:00.000Z", "v_amm": 0.3544897959}, {"t": "2019-02-14T05:00:00.000Z", "v_amm": 0.3187755102}, {"t": "2019-02-14T06:00:00.000Z", "v_amm": 0.2546}, {"t": "2019-02-14T07:00:00.000Z", "v_amm": 0.321}, {"t": "2019-02-14T08:00:00.000Z", "v_amm": 0.7671111111}, {"t": "2019-02-14T09:00:00.000Z", "v_amm": 0.8588}, {"t": "2019-02-14T10:00:00.000Z", "v_amm": 0.7617948718}, {"t": "2019-02-14T11:00:00.000Z", "v_amm": 0.4907843137}, {"t": "2019-02-14T12:00:00.000Z", "v_amm": 0.400212766}, {"t": "2019-02-14T13:00:00.000Z", "v_amm": 0.3742105263}, {"t": "2019-02-14T14:00:00.000Z", "v_amm": 0.4393023256}, {"t": "2019-02-14T15:00:00.000Z", "v_amm": 0.5460465116}, {"t": "2019-02-14T16:00:00.000Z", "v_amm": 0.362244898}, {"t": "2019-02-14T17:00:00.000Z", "v_amm": 0.3541860465}, {"t": "2019-02-14T18:00:00.000Z", "v_amm": 0.8687755102}, {"t": "2019-02-14T19:00:00.000Z", "v_amm": 0.6564444444}, {"t": "2019-02-14T20:00:00.000Z", "v_amm": 0.6487755102}, {"t": "2019-02-14T21:00:00.000Z", "v_amm": 0.5697368421}, {"t": "2019-02-14T22:00:00.000Z", "v_amm": 0.3656}, {"t": "2019-02-14T23:00:00.000Z", "v_amm": 0.2523913043}, {"t": "2019-02-15T00:00:00.000Z", "v_amm": 0.2346}, {"t": "2019-02-15T01:00:00.000Z", "v_amm": 0.1786363636}, {"t": "2019-02-15T02:00:00.000Z", "v_amm": 0.1639130435}, {"t": "2019-02-15T03:00:00.000Z", "v_amm": 0.2042222222}, {"t": "2019-02-15T04:00:00.000Z", "v_amm": 0.21375}, {"t": "2019-02-15T05:00:00.000Z", "v_amm": 0.1734693878}, {"t": "2019-02-15T06:00:00.000Z", "v_amm": 0.1911627907}, {"t": "2019-02-15T07:00:00.000Z", "v_amm": 0.2202040816}, {"t": "2019-02-15T08:00:00.000Z", "v_amm": 0.44}, {"t": "2019-02-15T09:00:00.000Z", "v_amm": 1.7514893617}, {"t": "2019-02-15T10:00:00.000Z", "v_amm": 0.3841666667}, {"t": "2019-02-15T11:00:00.000Z", "v_amm": 0.2727083333}, {"t": "2019-02-15T12:00:00.000Z", "v_amm": 0.4247826087}, {"t": "2019-02-15T13:00:00.000Z", "v_amm": 0.3145098039}, {"t": "2019-02-15T14:00:00.000Z", "v_amm": 0.5204}, {"t": "2019-02-15T15:00:00.000Z", "v_amm": 0.2789361702}, {"t": "2019-02-15T16:00:00.000Z", "v_amm": 0.3246}, {"t": "2019-02-15T17:00:00.000Z", "v_amm": 0.468125}, {"t": "2019-02-15T18:00:00.000Z", "v_amm": 0.2784444444}, {"t": "2019-02-15T19:00:00.000Z", "v_amm": 0.2495744681}, {"t": "2019-02-15T20:00:00.000Z", "v_amm": 0.207826087}, {"t": "2019-02-15T21:00:00.000Z", "v_amm": 0.2296078431}, {"t": "2019-02-15T22:00:00.000Z", "v_amm": 0.1797674419}, {"t": "2019-02-15T23:00:00.000Z", "v_amm": 0.1876086957}, {"t": "2019-02-16T00:00:00.000Z", "v_amm": 0.1755769231}, {"t": "2019-02-16T01:00:00.000Z", "v_amm": 0.1643181818}, {"t": "2019-02-16T02:00:00.000Z", "v_amm": 0.2426086957}, {"t": "2019-02-16T03:00:00.000Z", "v_amm": 0.3438}, {"t": "2019-02-16T04:00:00.000Z", "v_amm": 0.2142553191}, {"t": "2019-02-16T05:00:00.000Z", "v_amm": 0.1791489362}, {"t": "2019-02-16T06:00:00.000Z", "v_amm": 0.1652}, {"t": "2019-02-16T07:00:00.000Z", "v_amm": 0.1566666667}, {"t": "2019-02-16T08:00:00.000Z", "v_amm": 0.1433333333}, {"t": "2019-02-16T09:00:00.000Z", "v_amm": 0.2963043478}, {"t": "2019-02-16T10:00:00.000Z", "v_amm": 0.3028571429}, {"t": "2019-02-16T11:00:00.000Z", "v_amm": 0.3012244898}, {"t": "2019-02-16T12:00:00.000Z", "v_amm": 0.24875}, {"t": "2019-02-16T13:00:00.000Z", "v_amm": 0.26375}, {"t": "2019-02-16T14:00:00.000Z", "v_amm": 0.5273469388}, {"t": "2019-02-16T15:00:00.000Z", "v_amm": 0.4387755102}, {"t": "2019-02-16T16:00:00.000Z", "v_amm": 0.3848979592}, {"t": "2019-02-16T17:00:00.000Z", "v_amm": 0.5791666667}, {"t": "2019-02-16T18:00:00.000Z", "v_amm": 0.8112765957}, {"t": "2019-02-16T19:00:00.000Z", "v_amm": 0.8562790698}, {"t": "2019-02-16T20:00:00.000Z", "v_amm": 0.3962}, {"t": "2019-02-16T21:00:00.000Z", "v_amm": 0.3114583333}, {"t": "2019-02-16T22:00:00.000Z", "v_amm": 0.2510638298}, {"t": "2019-02-16T23:00:00.000Z", "v_amm": 0.22375}, {"t": "2019-02-17T00:00:00.000Z", "v_amm": 0.2366666667}, {"t": "2019-02-17T01:00:00.000Z", "v_amm": 0.3521428571}, {"t": "2019-02-17T02:00:00.000Z", "v_amm": 0.3085106383}, {"t": "2019-02-17T03:00:00.000Z", "v_amm": 0.259}, {"t": "2019-02-17T04:00:00.000Z", "v_amm": 0.3162222222}, {"t": "2019-02-17T05:00:00.000Z", "v_amm": 0.3095833333}, {"t": "2019-02-17T06:00:00.000Z", "v_amm": 0.2491111111}, {"t": "2019-02-17T07:00:00.000Z", "v_amm": 0.2243181818}, {"t": "2019-02-17T08:00:00.000Z", "v_amm": 0.2572916667}, {"t": "2019-02-17T09:00:00.000Z", "v_amm": 0.9667346939}, {"t": "2019-02-17T10:00:00.000Z", "v_amm": 0.6812244898}, {"t": "2019-02-17T11:00:00.000Z", "v_amm": 0.5327272727}, {"t": "2019-02-17T12:00:00.000Z", "v_amm": 0.4512244898}, {"t": "2019-02-17T13:00:00.000Z", "v_amm": 0.3831914894}, {"t": "2019-02-17T14:00:00.000Z", "v_amm": 0.7422727273}, {"t": "2019-02-17T15:00:00.000Z", "v_amm": 0.8354761905}, {"t": "2019-02-17T16:00:00.000Z", "v_amm": 0.7333333333}, {"t": "2019-02-17T17:00:00.000Z", "v_amm": 1.0157777778}, {"t": "2019-02-17T18:00:00.000Z", "v_amm": 0.9291666667}, {"t": "2019-02-17T19:00:00.000Z", "v_amm": 1.0820408163}, {"t": "2019-02-17T20:00:00.000Z", "v_amm": 0.9369230769}, {"t": "2019-02-17T21:00:00.000Z", "v_amm": 0.6525531915}]}, "did2": {"id": "did2", "data": [{"t": "2019-02-07T08:00:00.000Z", "v_alc": 0.344}, {"t": "2019-02-07T09:00:00.000Z", "v_alc": 0.3917777778}, {"t": "2019-02-07T10:00:00.000Z", "v_alc": 0.3252083333}, {"t": "2019-02-07T11:00:00.000Z", "v_alc": 0.2938}, {"t": "2019-02-07T12:00:00.000Z", "v_alc": 0.3093023256}, {"t": "2019-02-07T13:00:00.000Z", "v_alc": 0.472745098}, {"t": "2019-02-07T14:00:00.000Z", "v_alc": 0.3852}, {"t": "2019-02-07T15:00:00.000Z", "v_alc": 0.3438297872}, {"t": "2019-02-07T16:00:00.000Z", "v_alc": 0.4885714286}, {"t": "2019-02-07T17:00:00.000Z", "v_alc": 0.5139583333}, {"t": "2019-02-07T18:00:00.000Z", "v_alc": 0.4481818182}, {"t": "2019-02-07T19:00:00.000Z", "v_alc": 0.3231111111}, {"t": "2019-02-07T20:00:00.000Z", "v_alc": 0.305}, {"t": "2019-02-07T21:00:00.000Z", "v_alc": 0.3018367347}, {"t": "2019-02-07T22:00:00.000Z", "v_alc": 0.3054}, {"t": "2019-02-07T23:00:00.000Z", "v_alc": 0.326}, {"t": "2019-02-08T00:00:00.000Z", "v_alc": 0.3595833333}, {"t": "2019-02-08T01:00:00.000Z", "v_alc": 0.4104255319}, {"t": "2019-02-08T02:00:00.000Z", "v_alc": 0.3588}, {"t": "2019-02-08T03:00:00.000Z", "v_alc": 0.3382}, {"t": "2019-02-08T04:00:00.000Z", "v_alc": 0.305625}, {"t": "2019-02-08T05:00:00.000Z", "v_alc": 0.34325}, {"t": "2019-02-08T06:00:00.000Z", "v_alc": 0.3891666667}, {"t": "2019-02-08T07:00:00.000Z", "v_alc": 0.3381081081}, {"t": "2019-02-08T08:00:00.000Z", "v_alc": 0.5335897436}, {"t": "2019-02-08T09:00:00.000Z", "v_alc": 0.4008163265}, {"t": "2019-02-08T10:00:00.000Z", "v_alc": 0.3123404255}, {"t": "2019-02-08T11:00:00.000Z", "v_alc": 0.3280851064}, {"t": "2019-02-08T12:00:00.000Z", "v_alc": 0.2973333333}, {"t": "2019-02-08T13:00:00.000Z", "v_alc": 0.2947916667}, {"t": "2019-02-08T14:00:00.000Z", "v_alc": 0.3066}, {"t": "2019-02-08T15:00:00.000Z", "v_alc": 0.3938636364}, {"t": "2019-02-08T16:00:00.000Z", "v_alc": 0.5452380952}, {"t": "2019-02-08T17:00:00.000Z", "v_alc": 0.3494871795}, {"t": "2019-02-08T18:00:00.000Z", "v_alc": 0.325106383}, {"t": "2019-02-08T19:00:00.000Z", "v_alc": 0.3283333333}, {"t": "2019-02-08T20:00:00.000Z", "v_alc": 0.31375}, {"t": "2019-02-08T21:00:00.000Z", "v_alc": 0.3391836735}, {"t": "2019-02-08T22:00:00.000Z", "v_alc": 0.3617391304}, {"t": "2019-02-08T23:00:00.000Z", "v_alc": 0.3286}, {"t": "2019-02-09T00:00:00.000Z", "v_alc": 0.3425}, {"t": "2019-02-09T01:00:00.000Z", "v_alc": 0.3659090909}, {"t": "2019-02-09T02:00:00.000Z", "v_alc": 0.3580769231}, {"t": "2019-02-09T03:00:00.000Z", "v_alc": 0.3397826087}, {"t": "2019-02-09T04:00:00.000Z", "v_alc": 0.3319512195}, {"t": "2019-02-09T05:00:00.000Z", "v_alc": 0.3107843137}, {"t": "2019-02-09T06:00:00.000Z", "v_alc": 0.3089361702}, {"t": "2019-02-09T07:00:00.000Z", "v_alc": 0.3552173913}, {"t": "2019-02-09T08:00:00.000Z", "v_alc": 0.5072}, {"t": "2019-02-09T09:00:00.000Z", "v_alc": 0.4972}, {"t": "2019-02-09T10:00:00.000Z", "v_alc": 0.64175}, {"t": "2019-02-09T11:00:00.000Z", "v_alc": 0.4969565217}, {"t": "2019-02-09T12:00:00.000Z", "v_alc": 0.3991666667}, {"t": "2019-02-09T13:00:00.000Z", "v_alc": 0.4159183673}, {"t": "2019-02-09T14:00:00.000Z", "v_alc": 0.4604255319}, {"t": "2019-02-09T15:00:00.000Z", "v_alc": 0.6008333333}, {"t": "2019-02-09T16:00:00.000Z", "v_alc": 0.5222727273}, {"t": "2019-02-09T17:00:00.000Z", "v_alc": 0.3736956522}, {"t": "2019-02-09T18:00:00.000Z", "v_alc": 0.3779591837}, {"t": "2019-02-09T19:00:00.000Z", "v_alc": 0.3551020408}, {"t": "2019-02-09T20:00:00.000Z", "v_alc": 0.3625}, {"t": "2019-02-09T21:00:00.000Z", "v_alc": 0.3319047619}, {"t": "2019-02-09T22:00:00.000Z", "v_alc": 0.3476470588}, {"t": "2019-02-09T23:00:00.000Z", "v_alc": 0.3747916667}, {"t": "2019-02-10T00:00:00.000Z", "v_alc": 0.3697916667}, {"t": "2019-02-10T01:00:00.000Z", "v_alc": 0.3229545455}, {"t": "2019-02-10T02:00:00.000Z", "v_alc": 0.3221276596}, {"t": "2019-02-10T03:00:00.000Z", "v_alc": 0.3158}, {"t": "2019-02-10T04:00:00.000Z", "v_alc": 0.32125}, {"t": "2019-02-10T05:00:00.000Z", "v_alc": 0.3241860465}, {"t": "2019-02-10T06:00:00.000Z", "v_alc": 0.303125}, {"t": "2019-02-10T07:00:00.000Z", "v_alc": 0.3140425532}, {"t": "2019-02-10T08:00:00.000Z", "v_alc": 0.5367346939}, {"t": "2019-02-10T09:00:00.000Z", "v_alc": 0.3625581395}, {"t": "2019-02-10T10:00:00.000Z", "v_alc": 0.4341176471}, {"t": "2019-02-10T11:00:00.000Z", "v_alc": 0.411627907}, {"t": "2019-02-10T12:00:00.000Z", "v_alc": 0.466875}, {"t": "2019-02-10T13:00:00.000Z", "v_alc": 0.4318181818}, {"t": "2019-02-10T14:00:00.000Z", "v_alc": 0.3642222222}, {"t": "2019-02-10T15:00:00.000Z", "v_alc": 0.3268085106}, {"t": "2019-02-10T16:00:00.000Z", "v_alc": 0.393877551}, {"t": "2019-02-10T17:00:00.000Z", "v_alc": 0.4158695652}, {"t": "2019-02-10T18:00:00.000Z", "v_alc": 0.5480851064}, {"t": "2019-02-10T19:00:00.000Z", "v_alc": 0.5466}, {"t": "2019-02-10T20:00:00.000Z", "v_alc": 0.4887234043}, {"t": "2019-02-10T21:00:00.000Z", "v_alc": 0.4388461538}, {"t": "2019-02-10T22:00:00.000Z", "v_alc": 0.4172}, {"t": "2019-02-10T23:00:00.000Z", "v_alc": 0.3665306122}, {"t": "2019-02-11T00:00:00.000Z", "v_alc": 0.3511111111}, {"t": "2019-02-11T01:00:00.000Z", "v_alc": 0.3243589744}, {"t": "2019-02-11T02:00:00.000Z", "v_alc": null}
这是我尝试过的。我不确定如何深入了解嵌套标题。
import pandas as pd
from pandas.io.json import json_normalize
import json
with open('AQ_T1_Feb19.json') as file:
data = json.load(file)
df = json_normalize(data, ['status'],['data'])
df.to_csv('AQ_T1_Feb19.csv', encoding='utf-8', index=False)
csv 文件应将 t 和 v_amm 作为标题,并在列中包含相应的值。我无法上传图片,但希望您明白我的意思。
最佳答案
json_normalize
:record_path
键
{'data': {'metrics': {'mid1': {'did1': {'data': [{'t': <class 'str'>,
'v_amm': <class 'float'>}]},
'did2': {'data': [{'t': <class 'str'>,
'v_alc': <class 'float'>}]}}}}}
null
值,必须替换为 None
from pandas.io.json import json_normalize
import pandas as pd
data = {your json}
df_v_alc = json_normalize(data, ['data', 'metrics', 'mid1', 'did2', 'data'])
t v_alc
2019-02-07T08:00:00.000Z 0.344000
2019-02-07T09:00:00.000Z 0.391778
2019-02-07T10:00:00.000Z 0.325208
2019-02-07T11:00:00.000Z 0.293800
2019-02-07T12:00:00.000Z 0.309302
df_v_amm = json_normalize(data, ['data', 'metrics', 'mid1', 'did1', 'data'])
t v_amm
2019-02-07T08:00:00.000Z 0.320000
2019-02-07T09:00:00.000Z 0.322889
2019-02-07T10:00:00.000Z 0.209375
2019-02-07T11:00:00.000Z 0.167200
2019-02-07T12:00:00.000Z 0.196279
关于python - 如何将深度嵌套的 JSON 文件转换为 CSV?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58552315/
我正在尝试将一个字符串逐个字符地复制到另一个字符串中。目的不是复制整个字符串,而是复制其中的一部分(我稍后会为此做一些条件......) 但我不知道如何使用迭代器。 你能帮帮我吗? std::stri
我想将 void 指针转换为结构引用。 结构的最小示例: #include "Interface.h" class Foo { public: Foo() : mAddress((uint
这有点烦人:我有一个 div,它从窗口的左上角开始过渡,即使它位于文档的其他任何位置。我试过 usign -webkit-transform-origin 但没有成功,也许我用错了。有人可以帮助我吗?
假设,如果将 CSS3 转换/转换/动画分配给 DOM 元素,我是否可以检测到该过程的状态? 我想这样做的原因是因为我正在寻找类似过渡链的东西,例如,在前一个过渡之后运行一个过渡。 最佳答案 我在 h
最近我遇到了“不稳定”屏幕,这很可能是由 CSS 转换引起的。事实上,它只发生在 Chrome 浏览器 上(可能还有 Safari,因为一些人也报告了它)。知道如何让它看起来光滑吗?此外,您可能会注意
我正在开发一个简单的 slider ,它使用 CSS 过渡来为幻灯片设置动画。我用一些基本样式和一些 javascript 创建了一支笔 here .注意:由于 Codepen 使用 Prefixfr
我正在使用以下代码返回 IList: public IList FindCodesByCountry(string country) { var query =
如何设计像这样的操作: 计算 转化 翻译 例如:从“EUR”转换为“CNY”金额“100”。 这是 /convert?from=EUR&to=CNY&amount=100 RESTful 吗? 最佳答
我使用 jquery 组合了一个图像滚动器,如下所示 function rotateImages(whichHolder, start) { var images = $('#' +which
如何使用 CSS (-moz-transform) 更改一个如下所示的 div: 最佳答案 你可以看看Mozilla Developer Center .甚至还有例子。 但是,在我看来,您的具体示例不
我需要帮助我正在尝试在选中和未选中的汉堡菜单上实现动画。我能够为菜单设置动画,但我不知道如何在转换为 0 时为左菜单动画设置动画 &__menu { transform: translateX(
我正在为字典格式之间的转换而苦苦挣扎:我正在尝试将下面的项目数组转换为下面的结果数组。本质上是通过在项目第一个元素中查找重复项,然后仅在第一个参数不同时才将文件添加到结果集中。 var items:[
如果我有两个定义相同的结构,那么在它们之间进行转换的最佳方式是什么? struct A { int i; float f; }; struct B { int i; float f; }; void
我编写了一个 javascript 代码,可以将视口(viewport)从一个链接滑动到另一个链接。基本上一切正常,你怎么能在那里看到http://jsfiddle.net/DruwJ/8/ 我现在的
我需要将文件上传到 meteor ,对其进行一些图像处理(必要时进行图像转换,从图像生成缩略图),然后将其存储在外部图像存储服务器(s3)中。这应该尽可能快。 您对 nodejs 图像处理库有什么建议
刚开始接触KDB+,有一些问题很难从Q for Mortals中得到。 说,这里 http://code.kx.com/wiki/JB:QforMortals2/casting_and_enumera
我在这里的一个项目中使用 JSF 1.2 和 IceFaces 1.8。 我有一个页面,它基本上是一大堆浮点数字段的大编辑网格。这是通过 inputText 实现的页面上的字段指向具有原始值的值对象
ScnMatrix4 是一个 4x4 矩阵。我的问题是什么矩阵行对应于位置(ScnVector3),旋转(ScnVector4),比例(ScnVector3)。第 4 行是空的吗? 编辑: 我玩弄了
恐怕我是 Scala 新手: 我正在尝试根据一些简单的逻辑将 Map 转换为新 Map: val postVals = Map("test" -> "testing1", "test2" -> "te
输入: This is sample 1 This is sample 2 输出: ~COLOR~[Green]This is sample 1~COLOR~[Red]This is sam
我是一名优秀的程序员,十分优秀!