Also Python is different enough from R that my guesses about how to do things is always completely wrong. Instead I just asked ChatGPT. Maybe the code is off, well see, but definitely looks reasonable and is a good template.