I have followed the below mentioned link for creating Sunburst chart in Python: How to make a sunburst plot in R or Python?
Attached is the notebook for reference.
However, the data is required in a specific format for function to create the chart (list nested by level). Example:
data = [
('/', 100, [
('home', 70, [
('Images', 40, []),
('Videos', 20, []),
('Documents', 5, []),
]),
('usr', 15, [
('src', 6, [
('linux-headers', 4, []),
('virtualbox', 1, []),
]),
('lib', 4, []),
('share', 2, []),
('bin', 1, []),
('local', 1, []),
('include', 1, []),
]),
]),
]
sunburst(data)
For the same example, if someone gives me a decision tree output in an excel file with node hierarchy as levels, is there a way to convert this excel output(find below) as list above so I can create Sunburst using given function.
Excel Output:
Level0,Level1,Level2,Level3,Volume
/,,,,15
/,home,Images,,40
/,home,Videos,,20
/,home,Documents,,5
/,home,,,5
/,usr,src,linux-headers,4
/,usr,src,virtualbox,1
/,usr,src,,1
/,usr,lib,,4
/,usr,share,,2
/,usr,bin,,1
/,usr,local,,1
/,usr,include,,1