I have a dataframe: 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: What is the best way to do so? Answer Break list element into chunks first and then explode: If you