Json – Transform data with level column in python
I have data like this which represents hierarchical tree structure: [ { "level":0, "name":"python" }, { "level":1, "name":"food" }, { "level":2, "name":"banana" }, { "level":3, "name":"protein" }, { "level":2, "name":"apple" }, { "level":1, "name":"fuel" } ] I want to transform…