Home > other >  Turn to Python great god ~ ~ want to split the form, do permutation and combination in each block, t
Turn to Python great god ~ ~ want to split the form, do permutation and combination in each block, t

Time:11-25

The original table as follows, in the fifth line empty space (when a line of cells are empty time to separate), namely line 2-4 is a block, line 6-8 is a block,


Convert the table to form the following form, the first three rows are block1, behind is a result of block2 change



Now, for example, is a three column, 2 block form, but is actually more columns, multiple block


Permutation and combination I am consider using cartesian product or itertools, but now I don't know how to split each region, I understand now this case need to split out 6 in the small area on the list
But now I don't know how to operate, please god give directions, thank!!!!!!

CodePudding user response:

See for example, you think simplicity is better, probably pseudo code is as follows:

Locating the data row

Loop until the end of the
In turn read 3 lines, C1, C2 and C3 column to three list (excluding null), list_a, list_b, list_c
For a in list_a:
A for b in list_b:
For c in list_c:
Write a, b, c to excel in,

  • Related