I have data in this form
data = [
[2019, "July", 8, '1.2.0', 7.0, None, None, None],
[2019, "July", 10, '1.2.0', 52.0, "Breaking", 6.0, 'Path Removed w/o Deprecation'],
[2019, "July", 15, "0.1.0", 210.0, "Breaking", 57.0, 'Request Parameter Removed'],
[2019, 'August', 20, '2.0.0', 100.0, "Breaking", None, None],
[2019, 'August', 25, '2.0.0', 200.0, 'Non-breaking', None, None],
]
The list goes in this hierarchy: Year, Month, Day, info_version, API_changes, type1, count, content
I want to generate this hierarchical tree structure for the data:
{
"name": "2020", # this is year
"children": [
{
"name": "July", # this is month
"children": [
{
"name": "10", #this is day
"children": [
{
"name": "1.2.0", # this is info_version
"value": 52, # this is value of API_changes(always a number)
"children": [
{
"name": "Breaking", # this is type1 column( it is string, it is either Nan or Breaking)
"value": 6, # this is value of count
"children": [
{
"name": "Path Removed w/o Deprecation", #this is content column
"value": 6 # this is value of count
}
]
}
]
}
]
}
]
}
]
}
For all other months it continues in the same format.I do not wish to modify my data in any way whatsoever, this is how its supposed to be for my use case( graphical purposes). I am not sure how I could achieve this, any suggestions would be really grateful.
This is in reference to this format for Sunburst graph in pyecharts