I want to get those values of new_pattern_dataset
which are not present in all_pattern_dataset
. I am writing the following code:
new_pattern_dataset=[x for x in new_pattern_dataset if x not in all_pattern_dataset]
where
print(type(new_pattern_dataset))
new_pattern_dataset
OUTPUT:
[(1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0),
(0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1),
.
.
.
(1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0),
...]
print(type(all_pattern_dataset))
all_pattern_dataset
OUTPUT:
<class 'list'>
[array([0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1]),
array([0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1]),
.
.
.
array([0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0]),
...]
This gives me the error: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Can somebody please explain what am I doing wrong and how to correct it?
Also, since the type of both new_pattern_dataset
and all_pattern_dataset
is 'list', why do they have different formats?