【发布时间】:2020-06-20 19:42:24
【问题描述】:
我是 Python 新手,我的 Json 文件如下所示:
[
{
"Symbol": "TCS",
"Series": "EQ",
"Date": "04-May-2020",
"Prev Close": 2014.45,
"Open Price": 1966.0,
"High Price": 1966.0,
"Low Price": 1913.65,
"Last Price": 1930.5,
"Close Price": 1930.45,
"Average Price": 1939.3,
"Total Traded Quantity": 3729409.0,
"Turnover": 7232442404.05,
"No. of Trades": 165528.0,
"Deliverable Qty": 1752041.0,
"% Dly Qt to Traded Qty": 46.98
}
]
应该是这样的
{
"tcs":[
{
"Symbol": "TCS",
"Series": "EQ",
"Date": "04-May-2020",
"Prev Close": 2014.45,
"Open Price": 1966.0,
"High Price": 1966.0,
"Low Price": 1913.65,
"Last Price": 1930.5,
"Close Price": 1930.45,
"Average Price": 1939.3,
"Total Traded Quantity": 3729409.0,
"Turnover": 7232442404.05,
"No. of Trades": 165528.0,
"Deliverable Qty": 1752041.0,
"% Dly Qt to Traded Qty": 46.98
}
]
}
如何通过 Python 进行修改?
【问题讨论】:
标签: json python-3.x