@JordanCClark
Do you have any magic to combine these two rows based on that row 1 has 2
in the ITEM
column? I can do it with some ugly nested for loops, and I’m not good with list comprehensions, didn’t know if my script is the best way. Thanks!
before
row | STYLE | ACKNO | ACKLN | ITEM | FAB | WELT | COUNT | TOTAL | CLASS | PATTERN
-------------------------------------------------------------------------------------------------
0 | 990530 | 640403 | 60 | A-PILL 1 | OAK ISLAND 23 | | 2.0 | 2.0 | A | Y
1 | 990530 | 640403 | 60 | A-PILL 2 | BLUECOVE 22 | | 2.0 | 2.0 | B | Y
should look like this afterwards
row | STYLE | ACKNO | ACKLN | ITEM | FAB | WELT | COUNT | TOTAL | CLASS | PATTERN
-------------------------------------------------------------------------------------------------
0 | 990530 | 640403 | 60 | A-PILL 1 | OAK ISLAND 23/BLUECOVE 22 | | 2.0 | 2.0 | A | Y
My current script
for i,row in enumerate(ds2):
item = row['ITEM']
if '2' in item:
fab2 = row['FAB']
for j,row in enumerate(ds2):
if row['ITEM'] == item.replace('2','1'):
newFab = row['FAB'] + '/' + fab2
newData = system.dataset.setValue(ds2, j,'FAB',newFab)
newData = system.dataset.deleteRow(newData, i)