I don't think this is a typical wide to long question because the items I'm looking to turn to long are actually nested in list fields.
I have a uid field which is a list of integers, and another array which is a list of booleans that corresponds to the uid fields. I'd like to turn this array records into long records instead.
My data frame that looks like this:
name uid is_left colC colD colE ...
record01 [885] [True] .. .. .. ...
record02 [981] [False] .. .. .. ...
record03 [713, 981] [False, True] .. .. .. ...
record04 [713] [True] .. .. .. ...
record05 [126] [True] .. .. .. ...
I'd like to unwind it to:
name uid is_left colC colD colE ...
record01 885 True .. .. .. ...
record02 981 False .. .. .. ...
record03 713 False .. .. .. ...
record03 981 True .. .. .. ...
record04 713 True .. .. .. ...
record05 126 True .. .. .. ...
You can see record03
now has 2 entries, one for (713, False)
and one for (981, True)
.