Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import defaultdict
- #some code goes here presumably
- start = time.time()
- sap = self.wb_sap.worksheets[0] #Sets The First Sheet in the Excel Workbook as the variable sap IN THE FUTURE THIS WILL BE MODIFIED TO BE THE SAME NUMBERED SHEET AS BEFORE
- wt = self.wb_wt.worksheets[1]#Sets the Trimmed Sheet in the Second Report as the var wt
- #This Set of Nested Loops goes through Tests for X's to T's Based on the Report - Report Comparison
- print(datetime.datetime.today())
- indexed_wt = defaultdict(list)
- for wtrow in wt.iter_rows():
- key = (wtrow[3].value, wtrow[2].value)
- indexed_wt[key].append(wtrow)
- for saprow in sap.iter_rows():
- key = (saprow[3].value, saprow[2].value)
- for wtrow in indexed_wt[key]:
- if wtrow[4].value in ("T","P"): #New Report Entry is Marked as T/P
- self.deadrows.append(wtrow)
- if saprow[4].value is "X": #Old Report Entry is Marked as X
- self.XT += 1#Increment X->Ts Counts
- else:
- self.TT += 1#Increment T->T Count
- #uhhhhh. Not sure where these should go, since we deleted the `if` they used to connect to.
- #elif wtrow[4].value in ("T","P"):
- # self.deadrows.append(wtrow)
- #elif wtrow not in self.deadrows:
- # self.goodrows.append(wtrow)
- print("Timing: ", endtime-start)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement