I have a dataframe:
c1. c2. c3. l
1. 2. 3 [1,2,3,4,5,6,7]
3. 4. 8. [8,9,0]
I want explode it such that every 3 elements from each list in the column l will be a new row, and the column for the triplet index within the original list. So I will get:
c1. c2. c3. l idx
1. 2. 3 [1,2,3]. 0
1. 2. 3. [4,5,6]. 1
3. 4. 8. [8,9,0]. 0
What is the best way to do so?