I have a project wherein I have to remove activities from a certain array and store it in another array.
For example:
select_act = [2]
q_active = [2, 3]
The code I have so far looks like this:
for ele in select_act:
new_q_active = numpy.delete(q_active, numpy.where(ele))
print(new_q_active)
Output: new_q_active = [3]
The objective is to delete elements in q_active
if they're already in select_act
. The code I have above works for the given example. But for, let's say, all activities in q_active
are already in select_act
,
q_active = [2, 3]
select_act = [2, 3]
The output
I keep getting remains the same where it should be:
new_q_active = []
Any suggestion why I keep getting that? Any help would be appreciated! Thank you!