Welcome to Code Review! Please take a moment to
edit your post to 1) properly format the code: select all and press Ctrl+K to add the 4-space indent that formats it as a code block; 2) make the title summarize the purpose of the code, as stated in the watermark text of the title field; and 3) walk reviewers through your code,
present it to readers - "code dump" posts don't tend to do very well on this site, where reviewers easily spend 30, 60, 90 minutes and more crafting an answer: tell us about the data, the context,
why and
how things are done. Cheers! —
Mathieu Guindon 1 min ago