I have a for loop that is looping over a list for completing an API call. With each loop I have the json response run through pandas and append to REPL_ID:
import requests
import json
import pandas as pd
from pandas.io.json import json_normalize
REPL_ID = []
REPL = ["node01%4000-68D6FB-65377D-4804B8-A7F390%5B1-1-2D%5D",
        "node02%4000-B700F9-869677-4991B3-79CBE2%5B1-1-2E%5D",
        "node03%4000-94CF47-90E188-48728F-0538D8%5B1-1-19%5D"
       ]
def get_id():
    for value in REPL:
        url = func_repl(value)
        r = requests.get(url, headers=HEADERS, verify=False)
        jsonstring = json.dumps(r.json()["replication"])
        load = json.loads(jsonstring)
        df = json_normalize(load)
        df['NodeId'] = pd.Series(df.itemNodeId)
        df['ID'] = pd.Series(df.id).str.replace("{", "").str.replace("}", "")
        col = ['NodeId', 'ID']
        df1 = pd.DataFrame(df, columns=col)
        x = df1.to_dict('index')
        REPL_ID.append(x)
    return
After it completes, I have it print the contents of REPL_ID.
Output from REPL_ID:
[{
  0: {'NodeId': 'node01@00-68D6FB-65377D-4804B8-A7F390[1-1-2D]',
      'ID': '006bdade-49a8-4875-93de-54ba356403c4'},
  ...
  20: {'NodeId': 'node01@00-68D6FB-65377D-4804B8-A7F390[1-1-2D]',
      'ID': 'f8613a7d-30b1-4407-82f0-b92c82c6c422'}
  }, {
  0: {'NodeId': 'node03@00-94CF47-90E188-48728F-0538D8[1-1-19]',
      'ID': '065999f6-a3fe-4b1d-af35-7556efcc530e'},
  ...
  27: {'NodeId': 'node03@00-94CF47-90E188-48728F-0538D8[1-1-19]',
      'ID': 'cf96419c-a188-4b1a-85d6-bde41dbbe3ef'}
}]
Desired Output:
[{
  0: {'NodeId': 'node01@00-68D6FB-65377D-4804B8-A7F390[1-1-2D]',
      'ID': '006bdade-49a8-4875-93de-54ba356403c4'}
  ...
  78: {'NodeId': 'node03@00-94CF47-90E188-48728F-0538D8[1-1-19]',
      'ID': 'cf96419c-a188-4b1a-85d6-bde41dbbe3ef'}
}]
I'm having trouble flattening and reindexing this list. How can this be done?
I'm only collecting this information for completing the next API call which requires both NodeId and ID.