I have an array that needs certain elements removed. I am trying to have list comprehension do this for me, but it is not working.
It is a two dimensional array. For each row in the array if the first item, a str, meets two qualifications I would like it to be removed. However, when I use an "and" statement it only looks at the first statement. Why is this and how do you correct it?
act_array = [row for row in act_array if row[0][-4:] != '0660' and row[0][0] != '4' ] So I this example I want to copy all items that do not start with a 4 and whose last 4 chars do not equal 0660
Thanks