使用python通过关键字替换json数据密钥

如何将旧的json从逻辑_1,逻辑_2的所有键名重命名为逻辑(删除下划线和序列​​号)(ps:json文件中的数据通过循环获取获取多数据)

[
    {
        "logic_1": "NOT",   
        "StudyDescription": "",
        "SeriesDescription": "C\\+",
        "ImageComments": ""
    },
    {
        "logic_2": "NOT",
        "StudyDescription": "\\-C",
        "SeriesDescription": "\\-C",
        "ImageComments": "\\-C"
    }
]

[
        {
            "logic": "NOT",   
            "StudyDescription": "",
            "SeriesDescription": "C\\+",
            "ImageComments": ""
        },
        {
            "logic": "NOT",
            "StudyDescription": "\\-C",
            "SeriesDescription": "\\-C",
            "ImageComments": "\\-C"
        }
    ]
评论