guys below is my code which I created with the help of Pandas library in Python:
import pandas as pd
df = pd.DataFrame({'Col1':['r0','X Y Z','A D','B','r1','r0','Y Z X','D','r1','r0','X','G','H','Z','r1']})
I want to create a list from the elements of the data frame. This list must be split to the internal list of the group elements which are between r0 and r1 as in below:
[['r0','X','Y','Z','A','D','B','r1'],
['r0','Y','Z','X','D','r1'],
['r0','X','G','H','Z','r1']]
My problem is I can do this with multiple loops. However, this way is not suitable for my code. I would like to know what is the easiest way to solve this problem. Thank you for reading.