python解析json格式的数据_Python-解析JSON数据集

我正在尝试解析看起来像这样的JSON数据集:

{"data":[

{

"Rest":0,

"Status":"The campaign is moved to the archive",

"IsActive":"No",

"StatusArchive":"Yes",

"Login":"some_login",

"ContextStrategyName":"Default",

"CampaignID":1111111,

"StatusShow":"No",

"StartDate":"2013-01-20",

"Sum":0,

"StatusModerate":"Yes",

"Clicks":0,

"Shows":0,

"ManagerName":"XYZ",

"StatusActivating":"Yes",

"StrategyName":"HighestPosition",

"SumAvailableForTransfer":0,

"AgencyName":null,

"Name":"Campaign_01"

},

{

"Rest":82.6200000000008,

"Status":"Impressions will begin tomorrow at 10:00",

"IsActive":"Yes",

"StatusArchive":"No",

"Login":"some_login",

"ContextStrategyName":"Default",

"CampaignID":2222222,

"StatusShow":"Yes",

"StartDate":"2013-01-28",

"Sum":15998,"StatusModerate":"Yes",

"Clicks":7571,

"Shows":5535646,

"ManagerName":"XYZ",

"StatusActivating":"Yes",

"StrategyName":"HighestPosition",

"SumAvailableForTransfer":0,

"AgencyName":null,

"Name":"Campaign_02"

}

]

}

假设可以有许多这样的数据集。

我想遍历它们中的每一个并获取“名称”和“广告系列ID”参数。

到目前为止,我的代码看起来像这样:

decoded_response = response.read().decode("UTF-8")

data = json.loads(decoded.response)

for item in data[0]:

for x in data[0][item] ...

-> need a get name procedure

-> need a get campaign_id procedure

可能挺简单的!我对列表/字典不好:(

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值