I have a below dataframe
df =
city value
hyderabad 1
chennai 1
mumbai 2
pune 2
delhi 3
nodia 3
I want to split the dataframe into multiple dataframes to generate one combination for each dataframe, excluding the rows which has same value in a loop. The result sets would look like below.
df = city value
hyderabad 1
mumbai 2
delhi 3
df = city value
hyderabad 1
mumbai 2
nodia 3
df = city value
hyderabad 1
pune 2
delhi 3
df = city value
hyderabad 1
pune 2
nodia 3
df = city value
chennai 1
mumbai 2
delhi 3
df = city value
chennai 1
mumbai 2
nodia 3
df = city value
chennai 1
pune 2
nodia 3
df = city value
chennai 1
pune 2
delhi 3
What is the simplest way to get this done, as i dont know how many rows of data I will have in advance.