Skip to content
Advertisement

Updating the json file edited in Python

Suppose I have a json file like –

JavaScript

This is a single object. There are hundreds of objects similar to these. What i did was I accessed every ‘name’ from “name_list” and cleaned it using some rules. In that process some common name were removed. Now I want to update the cleaned data back to the json file. Note that if the common name is filtered then while updating the data back to json file the corresponding marks should also be removed. Can someone help me out on this? I have these json objects in a single file, which I opened using ‘smart_open’ library.

Advertisement

Answer

Let me show you with an example how you can do this:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement