0

The JSON file looks like this:

{
  "mgch_7": {
    "plot": {
      "ra": {
        [
          1547551080000,
          24
        ],
        [
          1547551140000,
          24
        ],
        [
          1547551200000,
          24
        ],
        [
          1547551260000,
          24
        ]
      ]
    },
    "user": {},
    "maintainance": {}
  }
}

In the DataFrame I want two columns, e.g.: 1547551080000 in one column and 24 in second column.

halloleo
  • 9,216
  • 13
  • 64
  • 122
  • 4
    Possible duplicate of [Python - How to convert JSON File to Dataframe](https://stackoverflow.com/questions/41168558/python-how-to-convert-json-file-to-dataframe) – User2321 Mar 21 '19 at 17:22
  • I can't figure it out please help – Pronnati Ramtekkar Mar 21 '19 at 17:43
  • that's not the same problem :) – Pronnati Ramtekkar Mar 21 '19 at 17:44
  • 1
    That JSON is not valid. I believe you have an extra ] in there – ecortazar Mar 21 '19 at 17:53
  • Also, that "set" of lists of pairs of values that you want to be converted should be a list of dictionaries in order for this to be a valid JSON (e.g., [{1547551080000 : 24}, {1547551140000, 24}], or [{'Val1': 1547551080000, 'Val2': 24}, {'Val1': 1547551140000, 'Val2': 24}]). – AlexK Mar 21 '19 at 19:20
  • Here is valid json close to above. `{ "mgch_7": { "plot": { "ra": { "a": [1547551080000, 24], "b": [1547551140000, 24], "c": [1547551200000, 24], "d": [1547551260000, 24] }, "user": {}, "maintainance": {} } } }` – Rich Andrews Mar 21 '19 at 22:05

0 Answers0