I'm using DataFrame.explode() to unnest a column of lists such that each element gets its own row. What I'm wondering is how to create a new 'index' column that will correspond to the index of the element in the original list. In the example I'm calling this column 'cycle'.
I've hopefully attached an image below of what I'm trying to achieve. If there is already a page on this please share. Thank you!