I'm trying to create a pandas dataframe from a class object in python.
The class object is the output of postman python script I got from the following tutorial: https://developer.cisco.com/meraki/build/meraki-postman-collection-getting-started/
I wish to take the output of this
print(response.text)
which gives:
[{"id":578149602163689207,"name":"Axel Network Test"},{"id":578149602163688579,"name":"Your org"},{"id":578149602163688880,"name":"Your org"},{"id":578149602163688885,"name":"Your org"},{"id":578149602163689038,"name":"Tory's Test Lab"},.......
I want to put this into a pandas dataframe with and ID column and name column.
import requests
import pandas as pd
url = "https://api.meraki.com/api/v0/organizations"
headers = {
'X-Cisco-Meraki-API-Key': "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
'User-Agent': "PostmanRuntime/7.15.0",
'Accept': "*/*",
'Cache-Control': "no-cache",
'Postman-Token': "7d29cb4e-b022-4954-8fc8-95e5361d15ba,1a3ec8cb-5da8-4983-956d-aab45ed00ca1",
'accept-encoding': "gzip, deflate",
'referer': "https://api.meraki.com/api/v0/organizations",
'Connection': "keep-alive",
'cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers)
I tired to write
df = pd.DataFrame(response, columns=['id', 'name'])
but this produces many errors.
See error log: https://pastebin.com/4BKFYng1
How can I achieve what I want?