from collections import defaultdict
tree = lambda : defaultdict(tree)
d = tree()
for _, (region, type, name, value) in df.iterrows():
    d['children'][region]['name'] = region
Pandas to D3. Serializing dataframes to JSON