Skip to content

Instantly share code, notes, and snippets.

View DGideas's full-sized avatar

Wanlin Wang 王万霖 DGideas

View GitHub Profile
a = [
{"userid":"Change","tags":[{"type":1,"tag_id":"e" }],},
{"userid":"andy.lei","tags":[{"type":1,"tag_id":"eg" },{"type":1,"tag_id":"ti"}],}
]
result = []
[*map(lambda x: result.extend([{"userid": x["userid"], "tagid": tag["tag_id"]} for tag in x["tags"]]), a)]
print(result)