This is the approach I would probably take
1. identify all of the pairs of items that are possible - have a look at
itertools.Combinations[
^] - use r = 2. E.g.
123|456
123|789
456|789
456|123
789|123
789|456
2. Generate pivoted data from the CSV to get [Sales Order No.] [list of items] e.g.
ABCD 123|789|
EFGH 456|
3. Compare the two lists to get the counts of matches e.g. see
The Best Ways to Compare Two Lists in Python[
^] - although to be honest by this stage I would probably be harnessing a database or Power Query
Edit: My step 3 is too simplistic - I'd probably do a count where Part 1 of my combo is "somewhere" in the list of items per order AND Part 2 of my combo is "somewhere" in the list of items per order, and therefore would not need the reversed combinations in the initial list i.e. would just need
123|456
123|789
456|789