Resolved: Create a data frame containin all possible permutations/combination given a string specifying the number of repetitions

In this post, we will see how to resolve Create a data frame containin all possible permutations/combination given a string specifying the number of repetitions

Question:

I would like to create a data frame that contains by row the 24^ combinations for all the letters of the alphabet, i.e. starting with:
and ending with:
this is what if found out:
Contentwise it is fine but I need it in the shape as above.

Best Answer:

Here is a possible approach using product() from itertools:
You could also get the alphabets using string.ascii_uppercase by importing string instead of having to write them.

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com