4
The Script below returns the intersection between arrays within a new array, I wanted to save the difference, in case what does not belong, how to modify this script ?
SCRIPT:
values = []
a = [('SRV', 'CLIENT'),('SRV1', 'CLIENT'),('SRV2', 'CLIENT')]
b = [('SRV', 'CLIENT'),('SRV1', 'CLIENT'),('SRV3', 'CLIENT')]
gap = []
for row in a:
if row[0] not in b:
gap.append(row)
OUTPUT:
[('SRV', 'CLIENT'), ('SRV1', 'CLIENT')]
GOAL
[('SRV2', 'CLIENT'')]
The logic would be the same if arrays were like this ? [u('SRV', 'CLIENT'),u('SRV1', 'CLIENT'),u('SRV2', 'CLIENT')] the example represents an array filled with a select of a DB.
– Luis Henrique
Strange array this way, ai is not array, explains better
– David
When I run one go inside the array the output is like this (u'campo',u'campo1',u'campo2')
– Luis Henrique
The database is db2,and use the libs ibm_db and ibm_db_dbi
– Luis Henrique