And...it was a failure. ChatGPT tried to use a method which seemed like it would have generated a couple of hundred lines of code, and it just crapped out in the middle. My intuition is that there is a more terse method of doing this in Python than what ChatGPT chose.