Permutations are the number of different combinations you can make when order matters. Permutations are a statistical tool data scientists, and data analysts use from time to time, and it is an important skill to know. To make a permutation function, you will need the itertools library.

To start, import the itertools library.

Image for post
Image for post

Next, let’s create a function. I’m going to name my function ‘possibilities.’ Your function can be any name, but you will see ‘possibilities’ as my function in this example.

Joseph Hart

Data Scientist

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store