每当键为“ current_values ”时,我想用与“ integers ”相同的值替换值(格式为字符串)。
d = {'id': '10', 'datastreams': [{'current_value': '5'}, {'current_value': '4'}]}
Run Code Online (Sandbox Code Playgroud)
期望的输出:
d = {'id': '10', 'datastreams': [{'current_value': 5}, {'current_value': 4}]}
Run Code Online (Sandbox Code Playgroud)