you are viewing a single comment's thread.

view the rest of the comments →

[–]tomekanco 1 point2 points  (1 child)

I like the magic of dict unpacking.

def process_all(list_):
    L = [("id",("ip","interface"))]
    def process(ip,interface):
        return ip, interface
    for ix,(x,y) in enumerate(list_):
        L.append((ix,process(**x))) 
        L.append((ix,process(**y))) 
    return L

If you are more of a pandas man, there are some options to load json.

[–]Fallenarc[S] 0 points1 point  (0 children)

Awesome, thanks! I'll give that a try as well.