I need to remove elements from a list whose elements reference for removal are in another list:
# Esta lista foi gerada por combinação
lista original=[
(182361, 243148, 360624, 364188),
(182361, 243148, 360624, 547083),
(182361, 243148, 360624, 486296),
(182361, 243148, 360624, 368820),
(182361, 243148, 360624, 365256),
(182361, 243148, 364188, 547083),
(182361, 243148, 364188, 486296),
(182361, 243148, 364188, 368820),
(182361, 243148, 364188, 365256),
(182361, 243148, 547083, 486296),
(182361, 243148, 547083, 368820),
(182361, 243148, 547083, 365256),
(182361, 243148, 486296, 368820),
(182361, 243148, 486296, 365256),
(182361, 243148, 368820, 365256),
(182361, 360624, 364188, 547083),
(182361, 360624, 364188, 486296),
(182361, 360624, 364188, 368820),
(182361, 360624, 364188, 365256),
(182361, 360624, 547083, 486296),
(182361, 360624, 547083, 368820),
(182361, 360624, 547083, 365256),
(182361, 360624, 486296, 368820),
(182361, 360624, 486296, 365256),
(182361, 360624, 368820, 365256),
(182361, 364188, 547083, 486296),
(182361, 364188, 547083, 368820),
(182361, 364188, 547083, 365256),
(182361, 364188, 486296, 368820),
(182361, 364188, 486296, 365256),
(182361, 364188, 368820, 365256),
(182361, 547083, 486296, 368820),
(182361, 547083, 486296, 365256),
(182361, 547083, 368820, 365256),
(182361, 486296, 368820, 365256),
(243148, 360624, 364188, 547083),
(243148, 360624, 364188, 486296),
(243148, 360624, 364188, 368820),
(243148, 360624, 364188, 365256),
(243148, 360624, 547083, 486296),
(243148, 360624, 547083, 368820),
(243148, 360624, 547083, 365256),
(243148, 360624, 486296, 368820),
(243148, 360624, 486296, 365256),
(243148, 360624, 368820, 365256),
(243148, 364188, 547083, 486296),
(243148, 364188, 547083, 368820),
(243148, 364188, 547083, 365256),
(243148, 364188, 486296, 368820),
(243148, 364188, 486296, 365256),
(243148, 364188, 368820, 365256),
(243148, 547083, 486296, 368820),
(243148, 547083, 486296, 365256),
(243148, 547083, 368820, 365256),
(243148, 486296, 368820, 365256),
(360624, 364188, 547083, 486296),
(360624, 364188, 547083, 368820),
(360624, 364188, 547083, 365256),
(360624, 364188, 486296, 368820),
(360624, 364188, 486296, 365256),
(360624, 364188, 368820, 365256),
(360624, 547083, 486296, 368820),
(360624, 547083, 486296, 365256),
(360624, 547083, 368820, 365256),
(360624, 486296, 368820, 365256),
(364188, 547083, 486296, 368820),
(364188, 547083, 486296, 365256),
(364188, 547083, 368820, 365256),
(364188, 486296, 368820, 365256),
(547083, 486296, 368820, 365256)
]
# pares de elementos que preciso remover da lista original, ou seja,
# se na lista original contiver qualquer desses pares que eles sejam
# substituidos por zero.
lista de remoção=[
[182361, 547083],
[243148, 486296],
[360624, 368820],
[364188, 365256]
]
I need the output to be a list consisting of elements in groups of 4 (as in the original list) whose elements do not contain elements of the peer reference list. Where the presence of any pair of the removal list exists, this element is replaced by zero.
I would like it to look like this:
lista final =[ (182361, 243148, 360624, 364188), (0, 243148, 360624, 0), (182361, 0, 360624, 0), (182361, 243148, 0, 0), (182361, 243148, 360624, 365256), (0, 243148, 364188, 0), (182361, 0, 364188, 0),
(182361, 243148, 364188, 368820), (182361, 243148, 0,0),
(0, 0, 0, 0), (0, 243148, 0, 368820), (0, 243148, 0, 365256),
(182361, 0,0, 368820), (182361, 0,0, 365256), (182361, 243148, 368820, 365256), (0, 360624, 364188, 0), (182361, 360624, 364188, 486296),
(182361, 0, 364188, 0), (182361, 360624, 0,0), (0, 360624, 0, 486296),
(0, 0, 0, 0), (0, 360624, 0, 365256), (182361, 0, 486296, 0),
(182361, 360624, 486296, 365256), (182361, 0, 0, 365256),
(0, 364188, 0, 486296), (0, 364188, 0, 368820), (0, 0, 0, 0),
(182361, 364188, 486296, 368820), (182361, 0, 486296, 0),
(182361, 0, 368820, 0), (0,0, 486296, 368820), (0,0, 486296, 365256),
(0,0, 368820, 365256), (182361, 486296, 368820, 365256), (243148, 360624, 364188, 547083), (0, 360624, 364188, 0), (243148, 0, 364188, 0),
(243148, 360624, 0,0), (0, 360624, 547083, 0), (243148, 0, 547083, 0),
(243148, 360624, 547083, 365256), (0, 0, 0, 0), (0, 360624, 0, 365256),
(243148, 0, 0, 365256), (0, 364188, 547083, 0), (243148, 364188, 547083, 368820), (243148, 0, 547083, 0), (0, 364188, 0, 368820), (0, 0, 0, 0),
(243148, 0, 368820, 0), (0, 547083, 0, 368820), (0, 547083, 0, 365256),
(243148, 547083, 368820, 365256), (0,0, 368820, 365256), (360624, 364188, 547083, 486296), (0, 364188, 547083, 0),(360624, 0, 547083, 0),
(0, 364188, 486296, 0), (360624, 0, 486296, 365256), (0, 364188, 0, 365256),
(0, 547083, 486296, 0), (360624, 547083, 486296, 365256), (0, 547083, 0, 365256), (0, 486296, 0, 365256), (364188, 547083, 486296, 368820),
(0, 547083, 486296, 0), (0, 547083, 368820, 0), (0, 486296, 368820, 0),
(547083, 486296, 368820, 365256)]
This would be the final list after deleting the element pairs from the exclusion list.