I have the following pandas dataframe df with 10 rows and 4 columns that attributes 3 categorical variables:
df = pd.DataFrame(np.random.choice(["dog", "cat", "mice"], size=(10, 4)))
I would to know all permutations possible between the rows and create a new dataframe containing different groupings of the row combinations such as a group containing twice the same variable in the same row as cat cat dog mice or 4 of the same pig pig pig pig etc. I have tried with Itertools without success. Someone to help with some indications? Thanks