# BEFORE print (weather_json['main']['temp']) old_key = 'main' new_key = 'main_weather' weather_json[new_key] = weather_json[old_key] del weather_json[old_key] # AFTER print (weather_json['main_weather']['temp'])